Skip to content

alihaider1204/CodeUnity

Repository files navigation

CodeUnity

CodeUnity is a full-stack web platform that connects students with developers for learning, Q&A, private messaging, paid bookings, and optional video calls.

Overview

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.

Features

  • 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.

Tech Stack

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

Repository Layout

├── src/                 # React SPA (pages, components, redux, utils)
├── public/              # Static assets
├── backend/             # Express API (routes, controllers, models, config)
└── README.md

Prerequisites

  • Node.js 18+ recommended
  • MongoDB (Atlas or local)
  • Accounts for Stripe, Pusher, ZegoCloud, and OAuth apps (Google/GitHub/LinkedIn) as needed

Quick Start

1. Clone and install

git clone <your-repo-url>
cd CodeUnity1

# Frontend
npm install

# Backend
cd backend
npm install
cd ..

2. Environment variables

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.env and using the same keys only in server-side config where possible.

3. Run locally

Terminal A — API

cd backend
npm run dev
# Default: http://localhost:5000

Terminal B — Frontend

npm run dev
# Vite default is often http://localhost:5173 — match FRONTEND_URL / CORS

4. Production build

npm run build
npm run preview   # optional local preview of the build

API Surface (high level)

REST 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.

Scripts

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

Contributing

Issues and pull requests are welcome. Keep secrets out of git; use .env files and document new variables in this README.

License

ISC (backend package.json). Confirm license for the whole monorepo if you publish publicly.


CodeUnity — connect, learn, and build with developers in one place.

About

Full-stack platform connecting students with developers: Q&A forum, real-time chat & notifications, Stripe orders & Pro subscriptions, and ZegoCloud video calls. React + Vite · Express + MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages