Skip to content

Xyphyn/photon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Photon

CI

Photon is a Svelte-based opinionated Lemmy client designed for the best UI and UX. Every feature is carefully considered and placed.

  • ๐ŸŒŸ A stunning UI
  • ๐Ÿช„ Lots of customization options
  • ๐Ÿ“ฑ Built for desktop & mobile
  • ๐ŸŒŽ Multi-language support
  • ๐Ÿ‘ฅ Save multiple accounts
  • ๐Ÿš€ Made with Svelte 5

Jump to:

Screenshots

Photon dark theme compact Photon light theme cozy

Self-hosting

You selfhost a Photon frontend server for your Lemmy instance, or independently for any instance.

Running from docker image

The images are at ghcr.io/xyphyn/photon. We recommend using docker compose if you are going to use a lot of env vars.

Note

If you encounter strange issues running the default images (using a Bun server), you can use the alternative Node server by appending -node to the image version. For example: ghcr.io/xyphyn/photon:v2.0.0-node

To run an unconfigured Photon instance on port 8080:

docker run -p 8080:3000 ghcr.io/xyphyn/photon:latest

Running natively

Clone the repo:

git clone https://github.com/xyphyn/photon && cd photon

Then to build and run:

Bun server (faster)
bun install
ADAPTER=bun bun run build

# run the built server
bun build/index.js
Node server (slower but better support)
npm install
ADAPTER=node npm run build

node build/index.js

Configuration

Photon lets you configure the default client settings and more.

Common

Note

Configuration environment variables are prefixed with PUBLIC to allow clients to use them. No sensitive data can be leaked.

If you're hosting Photon for a Lemmy instance, you' ll almost definitely want to set these:

  • PUBLIC_INSTANCE_URL string: The domain which the browser will send API requests to.

    • Example: PUBLIC_INSTANCE_URL=fedi.phtn.app
  • PUBLIC_SSR_ENABLED boolean: When enabled, will make page requests be rendered server side first, which allows search engine indexing, and basic non-js usage.

  • PUBLIC_INTERNAL_INSTANCE string: Only relevant if PUBLIC_SSR_ENABLED=true. This is the domain that the server will make API requests to.

  • PUBLIC_MIGRATE_COOKIE boolean: Useful if moving from lemmy-ui. This will automatically migrate the logins for the users, making them not have to login again.

  • PUBLIC_THEME JSON: If you'd like, you can export a theme from Photon and paste it here, which will become the default theme for users.

Default Photon options

Photon has extensive user configuration options, and you can set the defaults for them with the environment variables found at src/lib/settings.ts, by looking at the defaultSettings object.

Additional tips

Tip

It's recommended to setup some script to pull the latest docker image version or update some other way. Photon is constantly updated with fixes and improvements, and using heavily outdated versions can tarnish the reputation! So please keep it mostly up to date :)

Tip

If you'd like to let users pick any instance they want, set the environment variable PUBLIC_LOCK_TO_INSTANCE=false.

Tip

Photon supports nearly everything lemmy-ui does, so you can use it as a drop in replacement as the primary frontend. However, the instance must have already been setup.

FAQ

  • Q: I'm getting errors about header buffer size in NGINX!
  • A. You can apply the fix in this comment. You can also try using the Node server instead of the Bun server (instructions above)

Public Instances

Want your instance added here? Make a GitHub issue or make a PR. (this is for general purpose Photon instances.) If your instance stays out of date for a while, it will be removed.

phtn.app is the official instance and will get updates instantly.

Instance Location Contact
phtn.app (Official) ๐Ÿ‡บ๐Ÿ‡ธ US West photon@xylight.dev
ph.opnxng.com ๐Ÿ‡ธ๐Ÿ‡ฌ Singapore about.opnxng.com
p.darrennathanael.com ๐Ÿ‡ฎ๐Ÿ‡ฉ ID West noc@darrennathanael.com
p.lemmy.ohaa.xyz ๐Ÿ‡ฆ๐Ÿ‡น Austria (???)
phtn.ngn.tf ๐Ÿ‡น๐Ÿ‡ท Turkey ngn@ngn.tf

Donate

I've put my best effort into developing and maintaining this open source app. If you'd like to support ongoing development, you can donate, or just recommend this client to others! Buy me a Coffee

About

A sleek & opinionated but powerful Svelte based fediverse client.

Resources

License

Stars

Watchers

Forks

Packages