I wanted a full-stack project that goes beyond a todo app, something with real
authentication, real data modeling and a structure other developers could learn from.
So I built Commune, an open source community platform on the MERN stack, and I'm
releasing it today.
🔗 GitHub: https://github.com/Haseeb-MernStack/commune.git
What it is
Commune is a TypeScript monorepo with a React frontend, an Express + MongoDB backend
and a shared package for validation and types.
What's inside
- Secure auth: short-lived JWT access tokens plus rotating httpOnly refresh cookies. Refresh tokens are stored as SHA-256 hashes with a TTL index.
- Posts, comments and likes: with cursor-based pagination and a database-enforced one-like-per-user rule.
- Shared Zod schemas: the same validation runs in the browser and on the server, so the two never drift apart.
- Hardening: Helmet, CORS, rate limiting, body size limits and centralized error handling.
- Tooling: Docker Compose for MongoDB and the API, plus a GitHub Actions workflow.
Tech stack
React 18 · Vite · TanStack Query · Express · Mongoose · Zod · TypeScript · Docker
Run it locally
git clone https://github.com/Haseeb-MernStack/commune.git
cd commune
cp .env.example .env
docker compose up -d mongo
npm install
npm run dev
The API runs on localhost:4000 and the web app on localhost:5173.
Where I'd love your help
- Follows and a personalized feed
- Image uploads
- Real-time notifications
- Moderation tools
- More tests, especially database-backed ones
I've labeled a few issues good first issue so it's easy to jump in. If you're
looking for your first open source contribution, this is a friendly place to start.
Feedback welcome
What would you build first? What would you change in the architecture? Tell me in the
comments, and if the project is useful to you, a ⭐ on GitHub means a lot.
Top comments (0)