The official REST API powering ⛓️💥 NEXUS — aiming to be the central nervous system for all student clubs at the Army Institute of Technology, Pune. Built with ❤️ by the FE Members of GDG AIT.
| Service | URL |
|---|---|
| 🖥️ Frontend (NEXUS) | syncaitpune.vercel.app |
| ⚙️ Backend API Root | / → SYNC AIT BACKEND API |
sync-backend-api is a production-grade Node.js + Express REST API that drives the NEXUS platform. It handles everything from secure authentication flows (local + Google OAuth) to dynamic form management and task creation — all persisted in a MongoDB database via Mongoose.
| Layer | Technology |
|---|---|
| Runtime | Node.js (ESModules) |
| Framework | Express v5 |
| Database | MongoDB + Mongoose |
| Auth | JWT (httpOnly Cookies) + Google OAuth 2.0 |
| Nodemailer + Resend | |
| Security | bcrypt, CORS with credentials |
| Dev Tool | Nodemon |
- Node.js
v18+ - A running MongoDB instance (local or Atlas)
- Google OAuth credentials (for Google login)
- SMTP credentials for email (Nodemailer / Resend)
git clone https://github.com/MyTricks-code/sync-backend-api.git
cd sync-backend-apinpm installCreate a .env file in the project root:
# Server
PORT=8000
ORIGIN=http://localhost:5173
# MongoDB
MONGO_URI=your_mongodb_connection_string
# JWT
JWT_SECRET=your_jwt_secret
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
# Email (Nodemailer)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your_email@example.com
SMTP_PASS=your_email_password
# Resend (alternative email provider)
RESEND_API_KEY=your_resend_api_keynpm run devThe server will start on http://localhost:8000.
All routes are prefixed with /api.
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
POST |
/register |
❌ | Register a new user |
POST |
/login |
❌ | Login with email & password |
POST |
/logout |
❌ | Logout (clears cookie) |
POST |
/verify-otp |
✅ | Send email verification OTP |
POST |
/verify-account |
✅ | Verify account with OTP |
POST |
/forget-password |
❌ | Send forgot-password OTP |
POST |
/verify-forget-otp |
❌ | Verify OTP & reset password |
POST |
/update-user-info |
✅ | Update profile information |
POST |
/google-auth |
❌ | Sign in / Sign up via Google |
GET |
/get-user-info |
✅ | Fetch authenticated user's profile |
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
POST |
/create-form |
✅ | Create a new form |
GET |
/get-user-forms |
✅ | Fetch all forms created by user |
PUT |
/edit-form |
✅ | Edit an existing form |
DELETE |
/delete-form |
✅ | Delete a form |
GET |
/get-public-forms |
✅ | Get all public forms |
GET |
/get-form/:formId |
✅ | Get a specific form by ID |
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
Managed by responseController |
✅ | Form response submission & retrieval |
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
POST |
/create-task |
✅ | Create a new task |
sync-backend/
├── config/
│ ├── mongoDB.js # MongoDB connection setup
│ └── nodeMailer.js # Nodemailer transporter config
├── controllers/
│ ├── userController.js # Auth & user management logic
│ ├── googleAuth.js # Google OAuth handler
│ ├── formController.js # Form CRUD operations
│ ├── responseController.js# Form response handling
│ └── taskController.js # Task creation logic
├── helpers/ # Utility functions (email senders, etc.)
├── middlewares/
│ └── userAuth.js # JWT authentication middleware
├── models/
│ ├── userModel.js # User schema (local + Google auth)
│ ├── formsModel.js # Form schema
│ ├── responseModel.js # Response schema
│ └── taskModel.js # Task schema
├── routes/
│ ├── authRoutes.js
│ ├── formRoutes.js
│ ├── responseRoutes.js
│ └── taskRoutes.js
├── index.js # App entry point
└── package.json
┌─────────────┐ Register/Login ┌──────────────┐
│ Client │ ──────────────────────► │ Express API │
│ (NEXUS FE) │ ◄───────────────────── │ │
└─────────────┘ httpOnly JWT Cookie └──────┬───────┘
│
┌──────────────────────────┼──────────┐
▼ ▼ ▼
Email OTP Google OAuth 2.0 MongoDB
Verification (google-auth-lib)
Tokens are stored as httpOnly cookies — never exposed to JavaScript — for maximum security.
🔗 Explore the full NEXUS ecosystem: github.com/Jitesh-Yadav01/NEXUS
© 2025–26 GDG AIT Pune Frontend Team · Built for AIT Pune's student community 🎓