Prico aims to merge the core experiences of Discord (communities, chat, voice/video), VS Code (collaborative real‑time coding + execution), and GitHub (projects, forks, pull requests, publishing) into a single cohesive developer collaboration hub.
- User Accounts & Authentication: Sign up, log in, verify email, and reset passwords using Clerk
- Communities: Create and join communities with text, voice, and video channels
- Chat System: Real-time messaging with WebSockets, including typing indicators, reactions, and file uploads
- Voice & Video Chat: Real-time communication using WebRTC
- Projects: Create, fork, and collaborate on coding projects
- Collaborative Code Editor: Real-time collaborative editing with Monaco Editor and Yjs
- Code Execution: Execute code in a secure Docker sandbox
- Git Integration: Pull requests, forks, and project publishing
- Notifications: Real-time notifications for friend requests, mentions, PR updates, and more
- Next.js
- React
- TailwindCSS
- Shadcn UI
- Monaco Editor
- Yjs/CRDT for collaborative editing
- WebRTC for voice/video
- WebSockets for real-time features
- Node.js (TypeScript)
- Express (REST API)
- Socket.IO (real-time + signaling)
- MongoDB Atlas (Mongoose ODM)
- Clerk (authentication + session validation)
- Docker sandbox (isolated code execution)
- Yjs (CRDT) integration layer for collaborative editing
- WebRTC signaling via Socket.IO
- Node.js 18+
- pnpm (workspace manager)
npm i -g pnpm - Docker (for sandbox & optional local Mongo)
- A MongoDB Atlas cluster (or local MongoDB)
- Clerk application (Frontend + Backend keys)
-
Clone the repository:
git clone https://github.com/yourusername/prico.git cd prico -
Set up environment variables:
- Copy
.env.exampleto.envin the backend directory - Copy
.env.exampleto.env.localin the frontend directory - Fill in the required values
- Copy
-
Install dependencies (monorepo root):
pnpm install
-
Environment variables:
- Copy
apps/backend/.env.exampletoapps/backend/.env - Copy
apps/frontend/.env.exampletoapps/frontend/.env.local - Fill in Clerk keys, Mongo URI, JWT secret, etc.
- Copy
-
Development (runs backend + frontend concurrently):
pnpm dev
-
Access:
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- Socket.IO path:
/socket.io
prico/
├── package.json # Workspace root (pnpm workspaces)
├── apps/
│ ├── backend/ # Express + Socket.IO (TypeScript)
│ │ ├── src/
│ │ │ ├── config/ # Env, logging, security
│ │ │ ├── db/ # Mongoose connection & models
│ │ │ ├── routes/ # REST endpoints
│ │ │ ├── sockets/ # Socket.IO namespaces & handlers
│ │ │ ├── services/ # Business logic
│ │ │ ├── middleware/ # Auth, rate limit, errors
│ │ │ └── index.ts # Bootstrap
│ │ ├── tsconfig.json
│ │ └── package.json
│ └── frontend/ # Next.js (App Router) + Tailwind + Shadcn UI
│ ├── app/ # Routes
│ ├── components/
│ ├── lib/
│ ├── styles/
│ ├── package.json
│ └── tailwind.config.ts
├── packages/
│ └── shared/ # Shared types, validation schemas
└── docker-compose.yml (planned)
The API documentation is available at http://localhost:8000/docs when the backend is running.
Planned high-level organization (subject to iteration):
| Domain | Namespace | Example Events |
|---|---|---|
| Chat | /chat |
message:new, message:edit, message:delete, typing |
| Editor | /editor |
doc:init, doc:update, cursor:update, presence |
| RTC | /rtc |
webrtc:offer, webrtc:answer, webrtc:candidate, webrtc:leave |
| Notifications | /notify |
notification:new, notification:read |
| Friends | /social |
friend:request, friend:accept, presence:update |
All events pass through auth middleware validating Clerk session + internal JWT.
- Core scaffold (monorepo, backend health, frontend shell) ✅ (in progress)
- Auth integration (Clerk + backend session handoff JWT)
- Frontend authenticates with Clerk (Next.js
@clerk/nextjs). - Frontend posts to
POST /api/users/mewith Clerk session (Bearer automatically via Clerk middleware) including minimal profile (username, email, age, optional displayName). - Backend upserts user record and returns an
internalJwt(short‑lived) used for Socket.IO connection:const socket = io('http://localhost:4000', { auth: { token: internalJwt } }); socket.on('auth:ack', console.log);
- Protected data retrieval via
GET /api/users/me.
Endpoints (so far):
GET /api/healthPOST /api/users/me(create/upsert + internal token)GET /api/users/me
- Users & profiles CRUD + presence
- Communities & channels (text first)
- Realtime chat (Socket.IO) + persistence
- Collaborative editor (Yjs + persistence) baseline
- Projects model + file storage + basic CRUD
- Code execution sandbox (Docker) MVP
- Pull requests / forks / diff model
- WebRTC voice/video signaling
- Notifications system
- Hardening (RBAC, rate limiting, audit logs)
- Production Docker & Deployment scripts
Planned: MIT (to be added).