2 min read · 338 wordsfoundationarchitecture
Module 1: Foundation
Overview
Before any line of business logic makes sense, you need the shape of the system in your head: what FastAPI actually does with a request, how the four layers (routers → services → models → schemas) divide responsibility, where every file lives, and how SQLAlchemy talks to SQLite. This module builds that mental model directly from backend/app/ — no hypothetical architecture, the real one.
What You'll Learn
- What VeyraOps AI actually is and the problem it solves
- The layered architecture: why routers never touch OpenAI directly, why services never see HTTP
- The complete path of one request: FastAPI → Pydantic → service → database → response
- Every file and folder in
backend/app/, including the stray practice scriptsCLAUDE.mdflags as out of scope - SQLAlchemy's engine, session factory, declarative base, and the project's ad-hoc migration approach
Prerequisites
- Comfortable with Python (functions, classes, imports)
- Basic HTTP concepts (requests, responses, status codes)
- No prior FastAPI or SQLAlchemy experience required — this module starts from first principles
Lessons in This Module
| # | Lesson | What it covers |
|---|---|---|
| 01 | Project Overview | Vision, architecture at a glance, technology stack |
| 02 | Backend Architecture | The layered design and why it's separated this way |
| 03 | Request Lifecycle | One HTTP request traced end to end |
| 04 | Folder Structure | Every file, including the scratch/practice scripts |
| 05 | Database Layer | SQLAlchemy engine, sessions, Base, migrations |
Learning Outcomes
By the end of this module you can:
- Explain the request → router → service → database → response flow without looking at code
- Locate any piece of backend logic by knowing the folder structure
- Explain what
get_db()does and why it usesyield - Distinguish real application code from the stray practice scripts in
backend/app/