Python & MongoDB with Pure Python REST API β Syllabus
Module 1: Python Foundations (1.5β2 weeks)
- β Python installation & setup (pip, venv)
- β Data types & variables
- β Lists, dicts, sets, tuples
- β Control structures (if, loops)
- β Functions, modules, imports
- β Exception handling
- β File handling (JSON, CSV)
- β Basic OOP in Python
Module 2: MongoDB Basics (1.5 weeks)
- β NoSQL vs SQL, when to use MongoDB
- β Installing MongoDB (local & Atlas)
- β Databases, collections, documents
- β CRUD in Mongo shell
- β MongoDB data types
- β Query operators ($in, $gt, $lt, $or, $and)
- β Indexing basics
Module 3: PythonβMongoDB Integration (2 weeks)
- β Install pymongo
- β Connect Python app to MongoDB (local & Atlas)
- β Insert, find, update, delete documents
- β Handling ObjectId in Python
- β Working with nested documents
- β Aggregation pipeline with Python
- β Error handling in DB operations
Module 4: REST API in Pure Python (2.5 weeks)
- β Introduction to HTTP & REST principles
- β Pythonβs built-in http.server & BaseHTTPRequestHandler
- β Parsing requests (GET, POST, PUT, DELETE)
- β Sending JSON responses using json module
- β Connecting API routes with MongoDB CRUD operations
- β
Implement API Endpoints:
- POST /users β Create user
- GET /users β Fetch all users
- GET /users/{id} β Fetch single user
- PUT /users/{id} β Update user
- DELETE /users/{id} β Delete user
- β Testing APIs with Postman
Module 5: Advanced Topics (2 weeks)
- β Input validation in APIs
- β JWT Authentication in pure Python
- β Pagination & filtering queries
- β File upload β store file path / GridFS in MongoDB
- β Async requests with aiohttp + motor (async Mongo driver)
- β Organizing project with MVC-like folder structure
Final Project (1β1.5 weeks)
- β Build a complete User Management REST API in pure Python with MongoDB
- β User signup/login (JWT-based auth)
- β Profile CRUD operations
- β List/search users with filters
- β Aggregation endpoint (e.g., count users by role)
- β API documentation (Markdown / OpenAPI spec manually)
