# rudrakshvaishnav/qa-test-app architecture

> Architecture diagram of the GitHub repository rudrakshvaishnav/qa-test-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rudrakshvaishnav/qa-test-app
- Repository: https://github.com/rudrakshvaishnav/qa-test-app

## Overview

#### Purpose and Runtime Topology
QA Test Playground is a full-stack CRUD system intended to provide predictable, realistic REST and UI workflows for manual and automated QA. It runs a FastAPI API on Python and a separate React/Vite SPA. The frontend targets the versioned API URL supplied through Vite environment variables; the backend exposes OpenAPI/Swagger and health endpoints from its application entry point.
Paths: `backend/app/main.py`, `frontend/src/main.jsx`, `frontend/src/config/api.js`

#### Backend Application Composition
`main.py` constructs the FastAPI application, applies configuration/CORS, registers feature routers, and initializes database/seed behavior. Configuration centralizes API prefix, SQLite URL, JWT values, and allowed browser origins. This is the API composition boundary and deployment-facing service.
Paths: `backend/app/main.py`, `backend/app/config.py`, `backend/app/database.py`

#### Persistence and Domain Model
SQLAlchemy-backed SQLite persists five core entities: users, students, courses, attendance records, and notices. Model definitions form the relational/domain boundary; database session setup is consumed through dependencies by request handlers. A seeded local database supports an immediately usable QA environment with default data.
Paths: `backend/app/models/user.py`, `backend/app/models/student.py`, `backend/app/models/attendance.py`

#### API Feature Modules
Versioned REST resources are separated into routers for authentication and each CRUD domain. Routers translate HTTP requests into ORM operations, use dependency-provided sessions/authentication, and return validated schema payloads. Pydantic schemas isolate public request/response contracts from database models.
Paths: `backend/app/routers/auth.py`, `backend/app/routers/students.py`, `backend/app/schemas/auth.py`

#### Authentication and Access Boundary
Authentication endpoints issue JWT access tokens; shared dependencies validate tokens and establish the authenticated request context for protected resource operations. Backend error handling provides consistent API failure behavior. JWT secret, algorithm, and expiry remain environment-controlled deployment concerns.
Paths: `backend/app/dependencies.py`, `backend/app/routers/auth.py`, `backend/app/errors.py`

#### Frontend Application Shell and Navigation
The React entry mounts an application shell with routing. `App` maps login and domain pages; `ProtectedRoute` gates authenticated routes, while `Layout` and `Sidebar` provide the persistent post-login UI structure. An error boundary limits client-side rendering failures.
Paths: `frontend/src/main.jsx`, `frontend/src/App.jsx`, `frontend/src/components/ProtectedRoute.jsx`

#### Client Data and User Workflows
Feature pages implement dashboard, student, course, attendance, and notice workflows. Shared Axios service code sends API requests to the configured backend, and the authentication hook manages client auth state/token use. Reusable modal and card components support CRUD forms and dashboard presentation.
Paths: `frontend/src/services/api.js`, `frontend/src/hooks/useAuth.jsx`, `frontend/src/pages/Attendance.jsx`

#### External Interfaces and Deployment
The only material service dependency is the local/configured SQLite database; browser-to-API access is governed by backend CORS. FastAPI supplies OpenAPI documentation automatically, making the API independently consumable by Postman-like tools and automation suites. Production deployment requires separately serving the built Vite assets and Python API, with backend/frontend URLs, JWT secrets, and CORS origins supplied via environment.
Paths: `backend/.env`, `frontend/.env.production`, `backend/requirements.txt`

Main entry points: [`backend/app/main.py`](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/routers/students.py`](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/routers/students.py) (Versioned REST routers), [`frontend/src/services/api.js`](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/services/api.js) (Axios API client), [`frontend/src/App.jsx`](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/App.jsx) (App routes and shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React SPA"]
  node_frontend_entry["Vite React entry<br/>SPA bootstrap<br/>[main.jsx]"]
  node_app_shell["App routes and shell<br/>React routing<br/>[App.jsx]"]
  node_protected_route["Protected routes<br/>access guard<br/>[ProtectedRoute.jsx]"]
  node_feature_pages["CRUD feature pages<br/>React workflows<br/>[Attendance.jsx]"]
  node_auth_hook["Client auth state<br/>React hook<br/>[useAuth.jsx]"]
  node_api_client["Axios API client<br/>HTTP service<br/>[api.js]"]
  node_api_url_config["API URL configuration<br/>Vite environment config<br/>[api.js]"]
end

subgraph group_backend["FastAPI API"]
  node_api_app{{"FastAPI application<br/>API composition<br/>[main.py]"}}
  node_backend_config["Backend configuration<br/>environment settings<br/>[config.py]"]
  node_api_routers["Versioned REST routers<br/>HTTP resources<br/>[students.py]"]
  node_auth_router["Authentication endpoints<br/>auth resource<br/>[auth.py]"]
  node_auth_dependencies["JWT request context<br/>FastAPI dependencies<br/>[dependencies.py]"]
  node_api_schemas["Public API schemas<br/>Pydantic contracts<br/>[auth.py]"]
  node_error_handling["API error handling<br/>failure boundary<br/>[errors.py]"]
  node_openapi["OpenAPI / Swagger<br/>API documentation<br/>[main.py]"]
end

subgraph group_data["Persistence"]
  node_db_session["Database sessions and seed<br/>SQLAlchemy setup<br/>[database.py]"]
  node_domain_models["Domain models<br/>SQLAlchemy entities<br/>[student.py]"]
  node_sqlite[("SQLite database<br/>relational database")]
end

node_browser(("Browser / QA user<br/>client"))

node_browser -->|"loads SPA"| node_frontend_entry
node_frontend_entry -->|"mounts"| node_app_shell
node_app_shell -->|"applies"| node_protected_route
node_protected_route -->|"permits authenticated views"| node_feature_pages
node_app_shell -->|"uses"| node_auth_hook
node_feature_pages -->|"CRUD requests"| node_api_client
node_auth_hook -->|"supplies token"| node_api_client
node_api_url_config -->|"configures base URL"| node_api_client
node_api_client -->|"versioned REST over CORS"| node_api_app
node_api_app -->|"loads settings"| node_backend_config
node_api_app -->|"registers"| node_api_routers
node_api_app -->|"registers"| node_auth_router
node_api_app -->|"publishes"| node_openapi
node_auth_router -->|"issues tokens for"| node_auth_dependencies
node_api_routers -->|"protects operations with"| node_auth_dependencies
node_api_routers -->|"validates contracts"| node_api_schemas
node_api_routers -->|"uses sessions"| node_db_session
node_api_app -->|"uses"| node_error_handling
node_db_session -->|"persists"| node_domain_models
node_domain_models -->|"maps to"| node_sqlite

click node_frontend_entry "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/main.jsx"
click node_app_shell "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/App.jsx"
click node_protected_route "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/components/ProtectedRoute.jsx"
click node_feature_pages "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/pages/Attendance.jsx"
click node_auth_hook "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/hooks/useAuth.jsx"
click node_api_client "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/services/api.js"
click node_api_url_config "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/config/api.js"
click node_api_app "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/main.py"
click node_backend_config "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/config.py"
click node_api_routers "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/routers/students.py"
click node_auth_router "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/routers/auth.py"
click node_auth_dependencies "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/dependencies.py"
click node_api_schemas "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/schemas/auth.py"
click node_error_handling "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/errors.py"
click node_db_session "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/database.py"
click node_domain_models "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/models/student.py"
click node_openapi "https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_entry,node_app_shell,node_protected_route,node_feature_pages,node_auth_hook,node_api_client,node_api_url_config toneBlue
class node_api_app,node_backend_config,node_api_routers,node_auth_router,node_auth_dependencies,node_api_schemas,node_error_handling,node_openapi toneAmber
class node_db_session,node_domain_models,node_sqlite toneMint
class node_browser toneNeutral
```

## Components

### React SPA

- [Vite React entry](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/main.jsx): SPA bootstrap · `frontend/src/main.jsx`
- [App routes and shell](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/App.jsx): React routing · `frontend/src/App.jsx`
- [Protected routes](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/components/ProtectedRoute.jsx): access guard · `frontend/src/components/ProtectedRoute.jsx`
- [CRUD feature pages](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/pages/Attendance.jsx): React workflows · Dashboard, student, course, attendance, and notice screens. · `frontend/src/pages/Attendance.jsx`
- [Client auth state](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/hooks/useAuth.jsx): React hook · `frontend/src/hooks/useAuth.jsx`
- [Axios API client](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/services/api.js): HTTP service · `frontend/src/services/api.js`
- [API URL configuration](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/frontend/src/config/api.js): Vite environment config · `frontend/src/config/api.js`

### FastAPI API

- [FastAPI application](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/main.py): API composition · Applies CORS, registers versioned routers, and initializes database/seed behavior. · `backend/app/main.py`
- [Backend configuration](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/config.py): environment settings · Provides API prefix, SQLite URL, JWT settings, and allowed origins. · `backend/app/config.py`
- [Versioned REST routers](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/routers/students.py): HTTP resources · Authentication and CRUD resource endpoints. · `backend/app/routers/students.py`
- [Authentication endpoints](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/routers/auth.py): auth resource · Issues JWT access tokens. · `backend/app/routers/auth.py`
- [JWT request context](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/dependencies.py): FastAPI dependencies · Validates tokens for protected operations. · `backend/app/dependencies.py`
- [Public API schemas](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/schemas/auth.py): Pydantic contracts · `backend/app/schemas/auth.py`
- [API error handling](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/errors.py): failure boundary · `backend/app/errors.py`
- [OpenAPI / Swagger](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/main.py): API documentation · Independently consumable API interface. · `backend/app/main.py`

### Persistence

- [Database sessions and seed](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/database.py): SQLAlchemy setup · `backend/app/database.py`
- [Domain models](https://github.com/rudrakshvaishnav/qa-test-app/blob/main/backend/app/models/student.py): SQLAlchemy entities · Users, students, courses, attendance records, and notices. · `backend/app/models/student.py`
- **SQLite database**: relational database

### Other components

- **Browser / QA user**: client

## Connections

- Browser / QA user → Vite React entry: loads SPA
- Vite React entry → App routes and shell: mounts
- App routes and shell → Protected routes: applies
- Protected routes → CRUD feature pages: permits authenticated views
- App routes and shell → Client auth state: uses
- CRUD feature pages → Axios API client: CRUD requests
- Client auth state → Axios API client: supplies token
- API URL configuration → Axios API client: configures base URL
- Axios API client → FastAPI application: versioned REST over CORS
- FastAPI application → Backend configuration: loads settings
- FastAPI application → Versioned REST routers: registers
- FastAPI application → Authentication endpoints: registers
- FastAPI application → OpenAPI / Swagger: publishes
- Authentication endpoints → JWT request context: issues tokens for
- Versioned REST routers → JWT request context: protects operations with
- Versioned REST routers → Public API schemas: validates contracts
- Versioned REST routers → Database sessions and seed: uses sessions
- FastAPI application → API error handling: uses
- Database sessions and seed → Domain models: persists
- Domain models → SQLite database: maps to
