CodeUnity is a full-stack web platform that connects students with developers for learning, Q&A, private messaging, paid bookings, and optional video calls.
Students can browse verified developers, start conversations, place orders (including free tiers for junior developers), and pay securely. Developers manage orders, messages, and their profile. The app includes a discussion forum, real-time notifications (Pusher), Stripe payments and CodeUnity Pro subscriptions, and ZegoCloud-based video rooms.
- Authentication — Email/password flow with JWT; OTP and password reset; Google, GitHub, and LinkedIn OAuth (Passport).
- Role-based experience — Separate flows for students, developers, and admin areas.
- Discussion forum — Ask questions, browse by topic, sort (newest, oldest, most upvoted, most commented), replies and voting.
- Messaging — Conversations with lazy-loaded UI; Pusher-backed realtime where configured.
- Developer marketplace — List developers, book by hours, create offers, Stripe Checkout for paid orders, direct booking for free services.
- CodeUnity Pro — Subscription checkout, status, and 20% discount on eligible paid orders at checkout.
- Orders — Student and developer order views, order detail pages, feedback flows.
- Video calls — Room links and in-app ZegoCloud UIKit rooms (
/room/:roomId). - Support — FAQ and complaint submission.
- Resilience — Global error boundary on the client.
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite, React Router, TanStack React Query, Redux Toolkit, Axios, Bootstrap / MUI, Tailwind-related utilities |
| Backend | Node.js, Express, MongoDB (Mongoose), Passport, JWT, Multer, Nodemailer |
| Payments | Stripe (checkout sessions, webhooks for subscriptions) |
| Realtime | Pusher (auth via /pusher/auth) |
| Video | ZegoCloud UIKit Prebuilt |
├── src/ # React SPA (pages, components, redux, utils)
├── public/ # Static assets
├── backend/ # Express API (routes, controllers, models, config)
└── README.md
- Node.js 18+ recommended
- MongoDB (Atlas or local)
- Accounts for Stripe, Pusher, ZegoCloud, and OAuth apps (Google/GitHub/LinkedIn) as needed
git clone <your-repo-url>
cd CodeUnity1
# Frontend
npm install
# Backend
cd backend
npm install
cd ..Create backend/.env (never commit this file) with at least:
| Variable | Purpose |
|---|---|
MONGO_URI |
MongoDB connection string |
JWT_SECRET |
Sign JWT access tokens |
JWT_EXPIRES_IN |
Optional; default e.g. 7d |
SESSION_SECRET |
Express session encryption |
FRONTEND_URL |
CORS + Stripe redirect base (e.g. http://localhost:5173) |
FRONTEND_BASE_URL |
OAuth redirect return URL (align with Vite dev port if used) |
STRIPE_SECRET_KEY |
Stripe server secret |
STRIPE_WEBHOOK_SECRET |
Stripe webhook signing secret (subscriptions) |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
Google OAuth |
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET |
GitHub OAuth |
LINKEDIN_CLIENT_ID / LINKEDIN_CLIENT_SECRET |
LinkedIn OAuth |
EMAIL_USER / EMAIL_PASS |
Nodemailer (OTP / notifications) |
Create .env in the project root for Vite:
| Variable | Purpose |
|---|---|
VITE_BACKEND_URL |
API base URL (e.g. http://localhost:5000) |
VITE_ZEGOCLOUD_APPID |
ZegoCloud app ID (numeric) |
VITE_ZEGOCLOUD_SECRET |
ZegoCloud server secret (for test token generation in dev) |
VITE_CLOUDINARY_CLOUD_NAME |
If using Cloudinary uploads from the client |
Security: Rotate any keys that were ever committed or shared. Prefer moving Pusher credentials from code into
process.envand using the same keys only in server-side config where possible.
Terminal A — API
cd backend
npm run dev
# Default: http://localhost:5000Terminal B — Frontend
npm run dev
# Vite default is often http://localhost:5173 — match FRONTEND_URL / CORSnpm run build
npm run preview # optional local preview of the buildREST routes are mounted under prefixes such as /api/users, /api/discussion, /api/conversations, /api/developers, /api/students, /api/orders, /api/payments, /api/notifications, /api/subscription, /api/admin, /api/complaints, /api/badges, plus /auth/* for OAuth.
| Location | Command | Description |
|---|---|---|
| Root | npm run dev |
Vite dev server |
| Root | npm run build |
Production bundle |
| Root | npm run lint |
ESLint |
backend/ |
npm run dev |
Nodemon API |
backend/ |
npm start |
Node API |
Issues and pull requests are welcome. Keep secrets out of git; use .env files and document new variables in this README.
ISC (backend package.json). Confirm license for the whole monorepo if you publish publicly.
CodeUnity — connect, learn, and build with developers in one place.