CollabLearn is a skill-learning platform centered on the web experience. The active product surface is the React website, backed by an Express and MongoDB API for roadmaps, mentor workflows, community features, and admin tooling.
- Production: https://client-dun-ten-53.vercel.app/
The repository contains:
client/: React-based web frontend.server/: Node.js & Express backend API.flutter_app/: Secondary mobile codebase that is not the current product priority.
- AI Learning Roadmaps: Personalized generation based on skill, level, and timeline.
- Progress Tracking: Persistent learning plans to monitor your growth.
- AI Mentor Chat: Built-in guidance for next-step recommendations and study-session planning.
- Skill Marketplace: Platform for users to teach and learn from each other.
- Session Booking: 1v1 booking system with calendar management.
- Community Engagement: Posting, commenting, and real-time messaging with Socket.IO.
- Admin Console: Protected moderation, analytics, user management, and settings.
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express + MongoDB + Mongoose
- Real-time: Socket.IO
- Planning Engine: Local roadmap and study-session engine with optional external resource enrichment
- Framework: Flutter / Dart
- State Management: Provider
- Local Storage: Shared Preferences
- Networking: Http
-
Copy env templates:
cp .env.example .env cp server/.env.example server/.env cp client/.env.example client/.env
-
Install dependencies:
npm run setup
-
Start both apps:
npm run dev
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5001
Run these from the repository root:
npm run dev- run client and server in development mode.npm run build- build the client app.npm run test- run server and client tests.npm run lint/npm run lint:fix- run ESLint checks and autofix where possible.npm run format/npm run format:check- apply or verify Prettier formatting.
- Root
.env.exampleis a quick reference for commonly used variables. - Use
server/.env.exampleandclient/.env.exampleas canonical templates for each app. - Required server variables include
MONGODB_URIandJWT_SECRET. - Client variables use the
VITE_prefix (for example,VITE_API_URLandVITE_GOOGLE_CLIENT_ID).
The project includes several root-level scripts for development and maintenance:
| Script | Description |
|---|---|
start.bat |
Main entry point to run the entire stack. |
run_everything.bat |
Quickly starts all services. |
install_dependencies.bat |
Installs all required packages across all directories. |
clean.js |
Utility to clean up temporary files and caches. |
fix_deps.bat |
Resolves common dependency issues. |
debug_*.bat |
Various scripts for debugging client, server, and environment. |
run_flutter.bat |
Helper for the secondary Flutter codebase. |
server/scripts/seed-mock-data.js |
Seeds deterministic demo data into the active MongoDB database. |
Pull requests to main run ./.github/workflows/ci.yml, which installs dependencies and runs lint/test/build scripts when present.
Before opening a PR, run at least:
npm run lintnpm run testnpm run build
All three commands should complete successfully before you open or update a pull request.
- Set a strong
JWT_SECRETinserver/.env. The server now refuses placeholder secrets. - Browser auth now supports an
httpOnlysession cookie alongside bearer-token compatibility. Tune cookie behavior withAUTH_COOKIE_*variables inserver/.env. - Keep
CORS_ORIGINSrestricted to trusted frontend hosts in production. - Set
TRUST_PROXY=1when the API is deployed behind a reverse proxy or platform load balancer. - Optionally set
REDIS_URLto share rate-limit counters across multiple API instances. If Redis is unavailable, the server falls back to local in-memory counters instead of failing requests. - Use
DB_CONNECT_MAX_ATTEMPTS,DB_CONNECT_RETRY_BASE_MS, andDB_CONNECT_RETRY_MAX_MSif you need to tune MongoDB retry behavior for slower environments. - MongoDB connection failures no longer terminate the process immediately. The API stays up, retries in the background, and exposes the current readiness state through
/api/health. - Runtime uploads are served from
server/uploads/and should stay out of version control. - The AI model is configurable through
GEMINI_MODEL; if omitted, the server falls back togemini-2.0-flash.
The repo now includes a root-level render.yaml blueprint for a two-service Render setup:
collablearn-web: static frontend built fromclient/collablearn-api: Node/Express API built fromserver/
Before applying the blueprint, set these secret values in Render:
MONGODB_URIJWT_SECRETNVIDIA_API_KEYGEMINI_API_KEYif you want Gemini enabledVITE_GOOGLE_CLIENT_IDif you want Google auth enabled in the frontend
The blueprint wires the frontend to the API automatically through Render service references. VITE_API_URL and CORS_ORIGINS can now consume bare Render hostnames and normalize them to HTTPS at runtime.
The repository now includes a root-level vercel.json for monorepo frontend deployments.
- Build/install are pinned to the frontend package:
installCommand:npm install --prefix clientbuildCommand:npm run build --prefix clientoutputDirectory:client/dist
- SPA and API/upload rewrites are included so
/api/*and/uploads/*resolve to the deployed API domain.
Recommended setup:
- Deploy the frontend from the repository root in Vercel (no custom root directory needed).
- Set
VITE_GOOGLE_CLIENT_IDin the frontend project if Google sign-in is enabled. - Deploy the API as a separate Vercel project using
server/(it already includesserver/vercel.json). - Set
CORS_ORIGINSin the API project to include the frontend domain.
The server includes a deterministic seed script for local development and CI smoke runs:
npm run seed:mock --prefix serverUse npm run seed:mock:reset --prefix server to rebuild the demo dataset from scratch on a non-production database. The seeded credentials are printed by the script after it finishes.
The website currently uses the local learning engine exposed by the API. To verify engine status:
curl http://localhost:5001/api/ai/studio-statusThe status route returns the active provider and model metadata used by the web roadmap flow.
GET /api/modules: List available learning modules.POST /api/modules: Create a new module (Auth required).GET /api/modules/:id: View module details.PUT /api/modules/:id: Update module (Auth required).DELETE /api/modules/:id: Remove module (Auth required).
POST /api/ai/chat: Interactive mentor chat.POST /api/ai/roadmap: Generate personalized learning paths.POST /api/ai/study-session: Generate a focused next study session from the active plan.GET /api/ai/plans: Retrieve saved learning plans.PATCH /api/ai/plans/:planId/progress: Update learning progress.
- Admin website routes are protected server-side as well as in the client router.
- The server supports a super-admin email allow list.
- By default,
shahaadi285@gmail.comis treated as a protected super-admin account.