A powerful RESTful API for managing educational courses and quizzes, built with modern technologies.
🔹 Course Management
- Complete CRUD operations
- Detailed course information
- Chapter management
🔹 Quiz System
- Create and manage quizzes
- Auto-grading system
- Detailed result analysis
🔹 Technical Features
- RESTful API architecture
- Swagger documentation
- Pagination support
- Robust error handling
- 💻 Backend: Node.js & Express.js
- 🗄️ Database: MongoDB
- 📚 Documentation: Swagger UI
- 🧪 Testing: Postman
- Node.js
v14.0.0or higher - MongoDB
v4.4.0or higher - npm or yarn
- Clone the repository
git clone https://github.com/Chelseasingla1/Educational-Platform-API.git
cd education-api- Install dependencies
npm install- Environment Setup
Create
.envfile in root directory:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/education_platform- Database Setup
# Windows
net start MongoDB
# macOS
brew services start mongodb-community
# Linux
sudo service mongod start- Launch Application
# Development
npm run dev
# Production
npm startAccess the interactive API documentation at:
http://localhost:3000/api-docs
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/courses |
Create course |
GET |
/api/courses |
List courses |
GET |
/api/courses/:id |
Get course |
PUT |
/api/courses/:id |
Update course |
DELETE |
/api/courses/:id |
Delete course |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/courses/:courseId/quizzes |
Create quiz |
GET |
/api/courses/:courseId/quizzes |
List quizzes |
POST |
/api/quizzes/:id/submit |
Submit answers |
- Open Postman
- Import collection
- Configure environment:
{
"baseUrl": "http://localhost:3000"
}education-api/
├── 📂 config/
│ └── db.js
├── 📂 models/
│ ├── Course.js
│ ├── Quiz.js
│ └── QuizAttempt.js
├── 📂 routes/
│ ├── courseRoutes.js
│ └── quizRoutes.js
├── 📂 controllers/
│ ├── courseController.js
│ └── quizController.js
├── 📂 middleware/
│ └── errorHandler.js
├── 📄 .env
├── 📄 .gitignore
├── 📄 server.js
└── 📄 swagger.js
| Variable | Description | Default |
|---|---|---|
PORT |
Application port | 3000 |
MONGODB_URI |
MongoDB connection URL | mongodb://localhost:27017/education_platform |
{
"status": "error",
"message": "Error description",
"details": ["Additional details"]
}Chelsea Singla
Made with ❤️ and ☕