How vamshik249/vamshik_order-service works
Project type and purpose
• This is a single-responsibility, back‑end microservice written in Python, using FastAPI.
• Purpose: expose RESTful /orders endpoints for CRUD operations on customer orders.
• It’s containerized with Docker, using SQLite (easily swapped to another RDBMS).
File structure
• Top‑level:
• Dockerfile, requirements.txt, tests/, README.md
• app/ – houses the FastAPI application
• app/:
• main.py – creates the FastAPI app, includes router registration
• routers/orders.py – defines HTTP endpoints (POST, GET, PUT, DELETE)
• crud.py – contains business‑logic functions that talk to the database
• models.py – SQLAlchemy ORM models
• schemas.py – Pydantic request/response models
• database.py – SQLAlchemy engine and SessionLocal
• tests/:
• test_orders.py – pytest suite that hits the endpoints (or crud)
• Dockerfile and requirements.txt define container build and dependencies.
README for additional insights
• Tech stack: FastAPI, Uvicorn, SQLAlchemy, Pydantic, SQLite (or switchable), Docker, Pytest
• Deployment targets: container registry → AWS EC2/Lightsail or Render/Railway
• No external services beyond the database—though one might add Redis, external auth, or a load balancer later.