How akshattalwar001/ioscxaws-project works
1. Overall shape
- This repository is a single backend application with a static front-end. The backend appears to be a Python API service, and the frontend/ directory contains HTML/CSS/JavaScript pages that talk to it.
- The system domain is clearly a student/academic administration platform with modules for students, parents, accounts, documents, placements, internships, research, financial records, classifications, and NOC handling.
2. Runtime and entry points
- main.py is the likely application entry point.
- app/api/router.py is the central API composition layer, where the feature routes are aggregated.
- start.sh suggests the service is started as a scripted app process, likely for deployment or local launch.
3. HTTP/API boundary
- The backend is organized around app/routes/*.py, which hold the endpoint definitions for each business area:
- auth, account, student, parent, academic, academic_document, documents, financial, placement, internship, research, classification, noc, and dashboard.
- These route modules form the external API boundary consumed by the front-end and by any other clients.
4. Service layer
- Business logic is separated into app/services/*.py.
- Each route area has a matching service module, which implies a consistent flow:
- route handler receives request
- service performs validation/business rules
- service reads/writes persistence or files
- route returns schema-shaped response
- Notable shared services include authHelper.py, authorization_services.py, otp_services.py, and file_services.py, which likely support multiple feature modules rather than a single domain.
5. Domain model and persistence
- app/model/models.py contains the persistent entity definitions.
- app/schema/schemas.py holds request/response DTOs, separating API contracts from storage models.
- app/core/database.py is the database bootstrap/integration point.
- The presence of alembic/ and migration files indicates schema-managed relational persistence, with migrations such as string_pks and add_auth_fields.
6. Data flow through the system
- The dominant flow is:
- frontend page or API client calls a route
- route delegates to a service
- service uses models/database and sometimes file/OTP/auth helpers
- schema objects shape the response
- The dashboard module likely aggregates data from several domain services into a single view model for the UI.
7. Authentication and authorization boundary
- app/routes/auth.py, app/services/authHelper.py, app/services/authorization_services.py, and app/services/otp_services.py indicate a dedicated auth subsystem.
- The migration add_auth_fields.py suggests auth was added or evolved later, so auth is an explicit cross-cutting concern rather than an afterthought.
- create_admin.py, create_admins.py, and similar scripts indicate role/user bootstrap flows are part of the operational model.
8. Document and file handling
- app/routes/documents.py, app/routes/academic_document.py, and app/services/file_services.py show that document upload/storage is a first-class feature.
- This likely introduces a boundary between database records and physical file handling, with document_services.py coordinating metadata and storage operations.
9. Front-end architecture
- frontend/ is a mostly static client with dedicated pages such as login.html, register.html, dashboard2.html, students.html, profile.html, and my-profile.html.
- JavaScript lives under frontend/js/, with a shared API client in frontend/js/api.js and page-specific scripts in frontend/js/pages/.
- This suggests the UI is client-rendered on top of the API, not a server-rendered template app.
10. Operational and data-management scripts
- The many standalone scripts (populate_*, create_*, fix_*, clean_data.py, remove_students.py, reset_sequence.py, etc.) indicate a strong operational layer for seeding, repairing, and administering data.
- These scripts are part of the repo’s architecture because they interact directly with the same database and domain models, even though they are not request-path code.
11. Testing and validation
- Testing is split across root-level tests such as test_auth.py, test_db.py, test_student.py, plus a tests/ package with connectivity checks.
- conftest.py and tests/conftest.py indicate shared fixtures, likely for database setup and API client setup.
- pytest.ini and TESTING.md show testing is a first-class workflow.
12. Database and migration lifecycle
- alembic.ini, alembic/env.py, and versioned migration scripts show the database schema is intended to evolve in a controlled way.
- The checked-in test.db suggests SQLite is used at least for local/testing scenarios, though the abstracted database layer means the exact runtime DB can be swapped by configuration.
13. Architecture boundaries to diagram
- The clearest boxes for an architecture diagram are:
- Frontend static client
- API routes
- Service/business logic layer
- Database/models
- File/OTP/auth helpers
- Migrations/operations scripts
- External interaction is primarily between the frontend and backend API, with the backend bridging to the relational database and file storage.
14. Project character
- The repo is not a generic scaffold; it is a domain-heavy administrative system with many specialized modules and a strong separation between HTTP endpoints, business logic, and persistence.
- The README only points to a deployed instance, so the codebase itself is the best source of truth for the system architecture.
Main entry points: router.py API router · models.py Models · account.py Core APIs · auth.py Auth API
Components 19
Frontend
Static client pages and browser scripts
- Site pages · Login, register, dashboard, profile, students, and admin pages
frontend/index.html - Browser API · Shared client used by page scripts to call the backend
frontend/js/api.js - Page scripts · Per-page browser logic for dashboards, profiles, students, and add-student flows
frontend/js/pages/dashboard.js
Backend API
HTTP entrypoints and app bootstrap
- main.py · Primary application entrypoint
main.py - API router · Aggregates feature routes into the application
app/api/router.py - Auth API · Login, register, and auth-related endpoints
app/routes/auth.py - Student API · Student-facing endpoints
app/routes/student.py - Core APIs · Account, parent, academic, documents, financial, placement, internship, research, classification, noc, dashboard, and academic document endpoints
app/routes/account.py
Domain Logic
Business services and shared helpers
- Auth services · Authentication, authorization, and OTP helpers
app/services/authHelper.py - Student services · Student domain logic
app/services/student_services.py - Account services · Account and user management logic
app/services/account_services.py - Domain services · Parent, academic, document, financial, placement, internship, research, classification, NOC, and dashboard logic
app/services/dashboard_services.py - File services · Document/file handling boundary
app/services/file_services.py
Data Layer
Persistence models, schema contracts, and migrations
- Models · Persistent entity definitions
app/model/models.py - Schemas · API request and response contracts
app/schema/schemas.py - Database · Database configuration and connection setup
app/core/database.py - Migrations · Versioned schema evolution
alembic/versions
Operations
Bootstrap, seeding, maintenance, and validation scripts
- Admin scripts · Seeding, repair, cleanup, and bootstrap scripts
populate_users.py - Tests · API, database, and frontend connectivity tests
tests/test_connectivity.py
Connections 24
- main.py → API router: loads · App startup wires the route composition layer
- API router → Auth API: includes · Central router mounts authentication endpoints
- API router → Student API: includes · Central router mounts student endpoints
- API router → Core APIs: includes · Central router mounts the rest of the domain endpoints
- Auth API → Auth services: delegates · Auth endpoints call shared auth logic
- Student API → Student services: delegates · Student endpoints call student business logic
- Core APIs → Account services: delegates · Account-related endpoints use account services
- Core APIs → Domain services: delegates · Domain endpoints use their matching services
- Domain services → File services: uses · Document-oriented flows rely on file handling helpers
- Auth services → Models: reads/writes · Auth flows operate on persisted user and role entities
- Student services → Models: reads/writes · Student logic persists through ORM models
- Account services → Models: reads/writes · Account logic persists through ORM models
- Domain services → Models: reads/writes · Business services persist domain records
- Auth API → Schemas: shapes · Auth endpoints use DTO schemas
- Student API → Schemas: shapes · Student endpoints use DTO schemas
- Core APIs → Schemas: shapes · Other endpoints use DTO schemas
- Models → Database: connects · ORM models bind to the database layer
- Migrations → Database: evolves · Alembic migrations evolve the schema
- Site pages → Browser API: calls · Pages use the shared browser API client
- Page scripts → Browser API: calls · Page scripts talk to the backend through the shared client
- Browser API → API router: consumes · Browser client targets the backend API routes
- Admin scripts → Database: manages · Operational scripts inspect, seed, and repair database state
- Tests → API router: verifies · Connectivity and API tests validate the backend surface
- Tests → Site pages: verifies · Frontend connectivity tests validate the static client