Photoflux is a decentralized, Fediverse-compatible photo sharing social media platform built using the ActivityPub protocol.
It allows local and remote users (e.g., Mastodon users) to follow, interact, and exchange posts across federated servers.
This project demonstrates real-world implementation of distributed systems, federation, and open social networking standards.
Centralized social networks control user data and content.
Photoflux explores the future of decentralized social media using:
- Federation instead of central servers
- Open protocols instead of closed APIs
- Interoperability across platforms (Mastodon, Pleroma, etc.)
⚠️ IMPORTANTIf you are using ngrok for local development, you must run the following command every time you restart the application:
ngrok http 4000This is required because ngrok generates a new public URL on each restart, which must be updated in your application configuration (e.g.,
BASE_URL).
- User Registration & JWT Authentication
- Create, view, and manage photo posts
- Follow / Unfollow users
- Like and comment on posts
- WebFinger implementation
- Actor JSON endpoints
- Inbox / Outbox handling
- Remote Follow support (Mastodon compatible)
- HTTP Signatures for secure federation
- Accept / Follow activity handling
- Public feed via ActivityPub Outbox
- Node.js
- Express.js
- MongoDB
- ActivityPub Protocol
- HTTP Signatures
- JWT Authentication
- React
- Bootstrap
- Axios
- Ngrok (for federation testing)
- Postman
- Git & GitHub
[React Frontend]
|
REST + JWT
|
[Express Backend] ---- ActivityPub ----> [Remote Fediverse Servers]
|
MongoDB
git clone https://github.com/your-username/photoflux.git
cd photofluxcd backend
npm installPORT=4000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret
BASE_URL=https://your-ngrok-url
npm startcd frontend
npm install
npm run dev
This project uses per-user RSA key pairs for ActivityPub federation. Each user automatically gets their own unique keypair stored securely in the database during registration.
- ✅ Automatic key generation - No manual setup required
- ✅ Database storage - Keys stored securely in MongoDB
- ✅ Per-user isolation - Each actor has unique keys
- ✅ Username validation - Prevents undefined or empty usernames
- DO NOT run
genKey.js- It's deprecated (creates server-wide keys) - DO NOT use
utils/keys.js- File-based system is deprecated - Keys are automatically managed by the User model
📖 For detailed information, see KEY_MANAGEMENT.md
WebFinger: /.well-known/webfinger
Actor: /activitypub/users/:username
Inbox: /activitypub/inbox/:username
Outbox: /activitypub/outbox/:username
Followers: /activitypub/followers/:username
Following: /activitypub/following/:username
Mastodon remote follow
Remote Accept / Follow flow
Full remote post ingestion into local feed
ActivityPub Like & Announce activities
Media federation improvements
Moderation & reporting system
Scalable inbox queue processing
Contributions are welcome!
Please read CONTRIBUTING.md before submitting pull requests.
This project is licensed under the MIT License.
Avdhut Magar