A powerful, production‑grade backend system built with Node.js, Express, MongoDB, Redis, and a fully modular architecture.
This platform powers an educational system with secure authentication, session management, device tracking, academic content management, and role‑based access control.
- JWT Access Tokens
- Refresh Token Rotation
- Multi‑session login
- Device & IP tracking
- Login alerts via email
- Password reset (verification code)
- Admin login & signup
- HTTP‑only cookies
- Strong password validation
- Helmet, HPP, Rate Limiting, CORS
- Years
- Semesters
- Subjects
- Lectures
- Saved lectures
- Doctor lecture management
- Student lecture access
- File uploads for lecture materials
- Redis caching layer
- Cache invalidation strategy
- Winston logging with daily rotation
- Correlation ID per request
- Health check endpoint
- Swagger API documentation
- Clean modular architecture
- Jest + Supertest
- Mocked Redis
- Mocked Email
- Mocked Auth
- Mocked Network
- Full CRUD tests for:
- Auth
- Sessions
- Users
- Doctors
- Subjects
- Semesters
- Years
- Saved lectures
- Lectures
Make sure you have:
- Node.js (v20+ recommended)
- npm or Yarn
- MongoDB (local or Atlas)
- Redis (local or cloud)
git clone <repo-url>
cd TIC_Academy_Backend
npm installCreate a .env file in the root directory and fill it with your environment variables:
PORT=8000
NODE_ENV=development
DB_URI=your_mongodb_connection_string
JWT_SECRET=your_access_token_secret
JWT_EXPIRES_IN=30m
JWT_REFRESH_SECRET=your_refresh_token_secret
JWT_REFRESH_EXPIRES_IN=30d
JWT_REFRESH_EXPIRES_IN_DAYS=30
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=465
EMAIL_USER=your_email
EMAIL_PASSWORD=your_email_password
PRIVATE_KEY=uuid_valuenpm run start:devnpm run startnpm testSwagger UI is available at:
http://localhost:8000/api-docsThis includes full documentation for:
- Authentication
- Users
- Doctors
- Subjects
- Semesters
- Years
- Lectures
- Saved Lectures
- Sessions
POST /api/v1/auth/signup
{
"name": "John Doe",
"email": "john@example.com",
"password": "StrongPass@123!",
"passwordConfirm": "StrongPass@123!"
}GET /api/v1/subjects
Supports filtering, sorting, and pagination.
POST /api/v1/auth/refresh
Automatically rotates refresh tokens and creates a new session.
- Manage lectures
- View student progress
- Analytics
- MCQ quizzes
- Auto‑grading
- Student progress tracking
- Chat
- Forums
- Notifications
- Full‑text search
- Smart filters
- Recommendations
- Full i18n support
- Admin panel localization
We welcome contributions! Please follow these rules:
- Follow the ESLint rules (
.eslintrc.json) - Use consistent naming and formatting
feature/add-lecture-uploadbugfix/fix-refresh-tokenrefactor/improve-logging
- Fork the repo
- Create a feature branch
- Write clear and descriptive commit messages
- Ensure all tests pass before submitting
- Provide a detailed explanation of your changes in the PR description
- All new features must include appropriate tests
- All existing tests must pass before merging
This project is currently unlicensed.
All rights are reserved by the author (BasharBallan).
Usage, distribution, or modification of this project requires explicit permission.