How johanros21/colegioproyecto works
1. This is a two-tier monorepo: a Next.js/React/Tailwind frontend and a Django API backend. The system serves both a public institutional site and a role-based intranet for admin, students, and teachers.
2. The frontend is organized with the Next.js App Router. Route structure is the main architectural map: /login, public landing pages, /matricula, and /dashboard/... split into admin, alumno, and profesor experiences. middleware.ts suggests route protection and role-based access control at the edge.
3. The admin UI is the broadest client subsystem. It contains pages for academic administration, users, banners, caja/tesorería, matrícula, mensualidad, tienda, and a kanban/muro area. Reusable modal components under dashboard/admin/componentes indicate a CRUD-heavy interface built around dialogs and forms.
4. The student dashboard is self-service oriented: courses, schedule, grades, pension/payment status, profile, and store/cart flows. The teacher dashboard focuses on agenda, students, grades, courses, and profile. These dashboards are separate route trees but likely consume the same backend APIs with different permissions and payload shapes.
5. The backend has a standard Django core layer in backend/core with settings, URL dispatch, ASGI, and WSGI entry points. This is the application boundary that ties all domain apps into a single deployment.
6. backend/users is the identity/account subsystem. It has its own serializers, views, URLs, admin, and migrations, so user management is a first-class backend domain rather than a thin auth wrapper. This app likely drives login and role/profile data used by the frontend dashboards.
7. backend/academic is the primary business domain and the most complex backend app. Its migrations show a wide model surface: grades, enrollments, schedules, classrooms, periods, evaluations, report cards/grades, student profiles, admissions, notifications, communications, banners, holidays, events, pardons/indults, bug reports, and related setup data. The presence of services.py and signals.py implies business rules and side effects are separated from request handling.
8. The academic app also contains management commands such as init_colegio.py and init_grado.py, which indicate bootstrap/seed operations for initial school configuration. This matters for deployment and local setup because the system expects baseline educational data before the UI can function fully.
9. backend/finance and backend/store are separate domain boundaries for money and commerce. Finance aligns with payments, pensions, treasury/caja, and monthly obligations; store aligns with products, categories, orders, and carts. The frontend routes for mensualidad, caja, pension, and tienda map directly to these backend concerns.
10. The data model is persisted through Django ORM migrations, so the relational database is the system of record. The extensive migration history, especially in academic, shows an evolved production schema rather than a greenfield project; diagramming should reflect stable domain modules with a shared database, not isolated microservices.
11. Data flow is primarily browser → Next.js route/page/component → Django API endpoint → ORM/database, with some automatic backend events via signals. The frontend appears to be the presentation and interaction layer, while Django owns authorization, validation, persistence, and business workflows.
12. Overall, the architecture is best drawn as a modular monolith backend with multiple Django apps, fronted by a role-aware Next.js portal. The main boundaries to show are public site vs authenticated intranet, and within the intranet the three user personas plus the academic, finance, store, and identity backend domains.
Main entry points: academic Academic · admin Admin portal · core Core app · app App Router
Components 17
Next.js portal
App Router frontend for public site and role-based dashboards.
- App Router · Next.js application shell and route tree.
frontend/app - Access guard · Edge protection and role-based routing.
frontend/middleware.ts
Django backend
Modular monolith API with shared core and domain apps.
- Core app · Settings, ASGI/WSGI, and URL dispatch boundary.
backend/core - Users · Accounts, serializers, views, and role/profile data.
backend/users - Academic · School operations, scheduling, enrollment, grades, banners, communications, and events.
backend/academic - Rules layer · Business logic, side effects, and domain event handling.
backend/academic/services.py - Bootstrap data · Initial school and grade seeding commands.
backend/academic/management/commands - Finance · Payments, pensions, treasury, and obligations.
backend/finance - Store · Products, carts, orders, and categories.
backend/store - Relational DB · Shared system of record behind Django migrations.
Public site
Unauthenticated pages and enrollment flows.
- Landing · Institutional site and login entry points.
frontend/app/page.tsx - Matricula flow · Public enrollment and payment-related pages.
frontend/app/matricula
Role dashboards
Protected experiences for admin, students, and teachers.
- Dashboard shell · Shared intranet layout and entry route.
frontend/app/dashboard - Admin portal · Academic administration, users, billing, store, and moderation tools.
frontend/app/dashboard/admin - Student portal · Self-service courses, grades, schedule, pension, profile, and store.
frontend/app/dashboard/alumno - Teacher portal · Agenda, students, grades, courses, and profile.
frontend/app/dashboard/profesor - CRUD modals · Reusable dialogs and forms supporting admin workflows.
frontend/app/dashboard/admin/componentes
Connections 30
- App Router → Access guard: protects · Route protection and persona routing at the edge.
- App Router → Landing: renders · Public landing and login pages.
- App Router → Matricula flow: renders · Public enrollment and payment pages.
- App Router → Dashboard shell: routes to · Shared authenticated shell for intranet users.
- Dashboard shell → Admin portal: hosts · Admin experience.
- Dashboard shell → Student portal: hosts · Student experience.
- Dashboard shell → Teacher portal: hosts · Teacher experience.
- Admin portal → CRUD modals: uses · CRUD dialogs for administrative workflows.
- Landing → Core app: calls · Frontend data access through API endpoints.
- Matricula flow → Academic: calls · Enrollment and payment-related requests.
- Admin portal → Academic: calls · Academic administration APIs.
- Admin portal → Users: calls · User and role management APIs.
- Admin portal → Finance: calls · Cashier and monthly payment workflows.
- Admin portal → Store: calls · Store management workflows.
- Student portal → Academic: calls · Courses, grades, schedule, and profile data.
- Student portal → Finance: calls · Pension and payment status.
- Student portal → Store: calls · Store catalog and cart flows.
- Teacher portal → Academic: calls · Agenda, classes, students, and grades.
- Core app → Users: dispatches · Shared API and application boundary.
- Core app → Academic: dispatches · Shared API and application boundary.
- Core app → Finance: dispatches · Shared API and application boundary.
- Core app → Store: dispatches · Shared API and application boundary.
- Users → Relational DB: persists · Accounts and identity records.
- Academic → Rules layer: orchestrates · Separates request handling from business rules.
- Academic → Bootstrap data: seeds · Initial school configuration commands.
- Academic → Relational DB: persists · Academic domain data and history.
- Users → Relational DB: persists · Identity and profile data.
- Finance → Relational DB: persists · Billing and treasury data.
- Store → Relational DB: persists · Commerce data.
- Rules layer → Relational DB: triggers · Signals and side effects from domain logic.