Backend service for Brainly, built using Node.js, Express, TypeScript, and MongoDB.
This repository contains the API layer, database models, and core business logic powering the application.
- Node.js
- Express.js
- TypeScript
- MongoDB
- Mongoose
- dotenv
brainly-backend/
├── src/
│ ├── controllers/ # Request handlers
│ ├── routes/ # API routes
│ ├── models/ # Mongoose schemas
│ ├── middlewares/ # Custom middlewares
│ ├── config/ # DB & app configuration
│ ├── utils/ # Helper functions
│ └── index.ts # App entry point
├── .env.example
├── tsconfig.json
├── package.json
└── README.md-
Clone the repository
git clone https://github.com/<your-username>/brainly-backend.gitcd brainly-backend -
Install dependencies
npm install -
Environment Variables
Create a .env file in the root directory:
PORT=5000 MONGO_URI=your_mongodb_connection_string
You can refer to .env.example for required variables.
-
Development
npm run dev -
Production
npm run buildnpm start -
Server runs on:
http://localhost:5000
RESTful API architecture
MongoDB integration using Mongoose
Centralized error handling
Modular and scalable folder structure
Type-safe codebase with TypeScript
npm run dev # Start server in development mode npm run build # Compile TypeScript npm start # Start production server
Authentication & Authorization (JWT)
Input validation (Zod / Joi)
API documentation (Swagger)
Rate limiting & security enhancements
Unit & integration testing
Contributions are welcome! Feel free to open issues or submit pull requests.
📄 License
This project is licensed under the MIT License.