A modern, real-time college community platform with group chat, cohort management, friend system, and direct messaging.
- Google OAuth Registration — Students sign up with their college Google account
- Immersive Landing Page — High-end GSAP scroll animations, SVG path wiping, and Framer Motion elements
- Real-time Group Chat — WebSocket-powered messaging with typing indicators
- Cohort Auto-Tagging — Automatic year/branch detection from college email
- Friends System — Send/accept/reject friend requests
- Direct Messaging — 1-on-1 DMs between friends
- Ring-based RBAC — Hierarchical permission system (Admin → Manager → Elevated → Member)
- Event Management & Rewards — Create events with size limits, handle registrations, and distribute tiered rewards
- Virtual Badge Store — Manage platform inventory, allow students to redeem medals (Gold/Silver/Bronze) for their profile
- AI Chatbot Integration — Smart context-aware bot paths for student assistance
- Resource Sharing — Direct file/link sharing dedicated within system resources
- Admin Dashboard — Institution setup, user management, cohort configuration
- Auto-Join Rules — Configure which groups users automatically join based on year/branch
- Pluggable Web Deployments — Fully configured Vercel SPA routing (
vercel.json) alongside standard setups
| Layer | Technology |
|---|---|
| Backend | Node.js, Express, Socket.IO |
| Database | MongoDB (Prisma ORM) |
| Frontend | React 19, Vite, Tailwind CSS 4 |
| Auth | JWT + Google OAuth 2.0 |
| Nodemailer (SMTP) / Console |
- Node.js ≥ 18.x (download)
- MongoDB ≥ 6.x with replica set enabled
- npm ≥ 9.x (comes with Node.js)
- Google Cloud project with OAuth 2.0 credentials (for registration)
git clone https://github.com/your-org/comflex.git
cd comflexComflex requires MongoDB with replica set enabled (required for Prisma transactions).
🐧 Linux
Ubuntu/Debian-based:
# Install MongoDB Community Edition
sudo apt-get install -y gnupg curl
curl -fsSL https://www.mongodb.com/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update && sudo apt-get install -y mongodb-orgFedora-based:
# Create the repository file
cat <<EOF | sudo tee /etc/yum.repos.d/mongodb-org-7.0.repo
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/9/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.com/static/pgp/server-7.0.asc
EOF
# Install MongoDB
sudo dnf install -y mongodb-orgArch-based:
# Install MongoDB Community Edition via AUR (using yay as an example)
yay -S mongodb-bin mongodb-tools-binConfiguration (All Linux Distributions):
# Enable replica set: add to /etc/mongod.conf
# replication:
# replSetName: rs0
# Enable, start, and initialize
sudo systemctl enable --now mongod
mongosh --eval "rs.initiate()"🍎 macOS
# Install via Homebrew
brew tap mongodb/brew
brew install mongodb-community@7.0
# Start with replica set
mongod --replSet rs0 --dbpath /usr/local/var/mongodb --logpath /usr/local/var/log/mongodb/mongo.log --fork
# Initialize the replica set
mongosh --eval "rs.initiate()"🪟 Windows
- Download MongoDB Community from mongodb.com
- During install, choose "Complete" and install MongoDB Compass
- Edit
C:\Program Files\MongoDB\Server\7.0\bin\mongod.cfg:replication: replSetName: rs0
- Restart the MongoDB service from Services panel
- Open MongoDB Shell (mongosh) and run:
rs.initiate()
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env and fill in your values (see Environment Variables below)
# Generate Prisma client
npx prisma generate
# Push schema to database
npx prisma db push
# Start development server
npm run devcd frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Add your VITE_GOOGLE_CLIENT_ID
# Start development server
npm run dev- Go to Google Cloud Console
- Create a new project (or select existing)
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Set Application type: Web application
- Add Authorized origins:
http://localhost:5173(frontend dev)http://localhost:5000(backend dev)
- Copy the Client ID to:
backend/.env→GOOGLE_CLIENT_IDfrontend/.env→VITE_GOOGLE_CLIENT_ID
- Start both backend (
npm run devin/backend) and frontend (npm run devin/frontend) - Open
http://localhost:5173/login - Login with the seed admin credentials from
.env(SEED_ADMIN_EMAIL/SEED_ADMIN_PASSWORD) - Navigate to
/setupto configure your institution (name, email domain) - Go to
/adminto configure email parsing rules and cohort settings - Once configured, registration is enabled for students
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
MongoDB connection string with ?replicaSet=rs0 |
✅ |
JWT_ACCESS_SECRET |
Secret for signing access tokens | ✅ |
JWT_REFRESH_SECRET |
Secret for signing refresh tokens | ✅ |
SEED_ADMIN_EMAIL |
Initial admin email (created on first boot) | ✅ |
SEED_ADMIN_PASSWORD |
Initial admin password | ✅ |
FRONTEND_URL |
Frontend origin for CORS | ✅ |
GOOGLE_CLIENT_ID |
Google OAuth 2.0 Client ID | For registration |
EMAIL_PROVIDER |
console (dev) or smtp |
❌ |
EMAIL_FROM |
Sender email address | ❌ |
SMTP_HOST/PORT/USER/PASS |
SMTP credentials | If smtp |
| Variable | Description |
|---|---|
VITE_GOOGLE_CLIENT_ID |
Same Google Client ID as backend |
| Endpoint | Description |
|---|---|
POST /api/v1/auth/google |
Google OAuth login/register |
POST /api/v1/auth/login |
Email/password login |
POST /api/v1/auth/set-password |
Set password (Google users) |
POST /api/v1/auth/set-username |
Choose username |
GET /api/v1/friends |
List friends |
POST /api/v1/friends/request |
Send friend request |
GET /api/v1/dm |
List DM conversations |
POST /api/v1/dm/:userId |
Send a DM |
USE /api/v1/events |
Events, team formation & submissions |
USE /api/v1/store |
Badge inventory, rewards & purchases |
USE /api/v1/groups |
Group chats, members & ring checks |
USE /api/v1/resources |
File sharing and resource nodes |
USE /api/v1/chatbot |
Conversational AI interfaces |
GET /api/v1/admin/auto-join-rules |
Get auto-join rules |
PUT /api/v1/admin/auto-join-rules |
Set auto-join rules |
See RULES.md for the complete API contract and data model documentation.
comflex/
├── backend/
│ ├── prisma/schema.prisma # Data models (MongoDB)
│ ├── src/
│ │ ├── config/env.js # Environment config
│ │ ├── middleware/ # Auth, RBAC, error handling
│ │ ├── routes/ # REST API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # JWT, password, response helpers
│ └── .env # Environment variables
├── frontend/
│ ├── src/
│ │ ├── api/ # API client modules
│ │ ├── components/ # Reusable UI components
│ │ ├── context/ # React context (Auth)
│ │ ├── pages/ # Route pages
│ │ └── App.jsx # Root routing
│ └── .env # Frontend env
├── RULES.md # Design rules & API contracts
├── doNext.md # Next-phase roadmap
└── README.md # This file
MIT