Complete Python & MongoDB Syllabus (Pure Python REST API – No Flask/Django)

Complete Python & MongoDB Syllabus (Pure Python REST API – No Flask/Django)

AI Reading

Quick summary of this article

This syllabus outlines a step-by-step path to build a REST API from scratch using only Python and MongoDB, without relying on web frameworks like Flask or Django. It covers everything from basic Python programming and MongoDB fundamentals to advanced topics like authentication and async operations, culminating in a final project where you build a complete user management system.

  • It is structured into five main modules, starting with Python foundations and MongoDB basics, then moving to integration with PyMongo and building a pure Python REST API using built-in modules like http.server.
  • The core of the course focuses on creating a REST API with specific endpoints for user management, including creating, reading, updating, and deleting users (CRUD operations).
  • Advanced topics include JWT-based authentication, input validation, pagination, file uploads with GridFS, and using asynchronous libraries like aiohttp and motor.
  • The final project is a complete User Management REST API with JWT authentication, profile CRUD, search filters, and an aggregation endpoint, to be tested with tools like Postman.
  • The curriculum is project-oriented, designed to teach you how to create a functional and secure API using only Python's standard library and the official MongoDB driver.

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)

Leave a Reply

Your email address will not be published. Required fields are marked *