Skip to content
2 min read · 338 words

Module 1: Foundation

**Beginner**  ·  **~60 min**  ·  **5 lessons**

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 scripts CLAUDE.md flags 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

#LessonWhat it covers
01Project OverviewVision, architecture at a glance, technology stack
02Backend ArchitectureThe layered design and why it's separated this way
03Request LifecycleOne HTTP request traced end to end
04Folder StructureEvery file, including the scratch/practice scripts
05Database LayerSQLAlchemy 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 uses yield
  • Distinguish real application code from the stray practice scripts in backend/app/

Start Module → Back to Course Overview