An open source community platform (profiles, posts, comments, likes, follows) built on the MERN stack with TypeScript.
| Layer | Tech |
|---|---|
| Web | React 18, Vite, TypeScript, React Router, TanStack Query |
| API | Node 20, Express, TypeScript, Mongoose, Zod, JWT |
| Shared | Zod schemas + inferred types used by both web and API |
| Tooling | npm workspaces, Prettier, Vitest, Docker, GitHub CI |
commune/
├── apps/
│ ├── web/ React frontend
│ └── api/ Express + MongoDB backend
├── packages/
│ └── shared/ Shared validation schemas and types
├── docs/ Architecture and API notes
├── .github/workflows/ CI
├── docker-compose.yml MongoDB + API
└── .env.example
cp .env.example .env
docker compose up -d mongo # or point MONGODB_URI at your own MongoDB
npm install
npm run dev # API on :4000, web on :5173A free production setup (Vercel + Render + MongoDB Atlas + Cloudinary) is described step by step in docs/DEPLOYMENT.md.
Admins review reported posts at /admin. There is no signup rule or API for this, so nobody can
claim the role by registering first. Register your account in the app, then run:
npm run make-admin -w @commune/api -- you@example.comLog out and back in, and an Admin link appears in the header.
npm run devruns API and web togethernpm run typechecktype-checks every workspacenpm testruns API testsnpm run buildbuilds shared, API and web
- Auth (register, login, refresh, logout)
- Posts, comments, likes
- Follows and a "Following" feed
- User profiles with editable bios
- Notifications (likes, comments, new followers) with unread badge
- Image uploads (post images and profile photos)
- Real-time notifications (WebSockets / SSE instead of polling)
- Moderation tools (reports, admin queue, post removal, account suspension)
- Email verification and password reset (Resend)
MIT
An open source community platform built with the MERN stack and TypeScript.
Commune is a production-minded, full-stack reference project: secure authentication, posts, comments and likes, a shared validation layer, Docker support and CI, all in a clean monorepo that's easy to read, run and extend.
- Secure auth with short-lived JWT access tokens and rotating httpOnly refresh cookies
- Posts, comments and likes with cursor-based pagination
- Shared Zod schemas used by both frontend and backend
- Helmet, rate limiting, input validation and centralized error handling
- Docker Compose for MongoDB and the API, plus a GitHub Actions workflow
Contributions of all sizes are welcome. Look for issues labeled good first issue,
read CONTRIBUTING.md, and open a pull request.