How kevinguzman420/delagracia-app-cra works
1. Overall shape
This repository is a two-part system: a React frontend in src/ and a Python API backend in api/. The frontend is a single-page app, while the backend is organized as a domain-based service with separate modules for authentication, admin, and each department.
2. Frontend boundary
The browser app is centered around src/App.js, src/pages/, and src/components/. Pages handle route-level screens, components handle reusable UI, and ProtectedRoute.jsx/department-specific protection components gate access to authenticated or role-specific areas.
3. Frontend domain layout
The UI is split by business area: admin, departments, new believer flows, and personal account. Under src/components/departments/, each department has its own container, director views, member views, and shared/common subcomponents. This is a strong clue that each department has independent workflows but shares a common app shell.
4. Frontend state and data flow
src/context/Departments/ contains a context/reducer/state trio, so department data is managed centrally rather than passed deeply through props. The typical flow is: page loads → context or component fetches API data → forms/modals update state → UI refreshes lists and detail panels.
5. Modal-driven interactions
A large portion of user actions happen through modal dialogs in src/components/modal-content/ and the generic Modal.jsx. These modals are used for operations like adding members, assigning tutors/CDPs, creating discipleships/networks, and showing details. That means many workflows are list-first with inline object creation/editing.
6. Backend structure
The API in api/app/ is split into packages by domain: auth, admin, departments, networks, school, new_convert, and various. Each domain package includes api_v1_0/resources.py and often schemas.py and models.py, indicating a layered design of HTTP resources, serialization/validation, and persistence models.
7. Backend core infrastructure
Shared backend infrastructure lives in db.py, ext.py, models.py, and schemas.py. config/ contains environment-specific settings (default, dev, prod), and entrypoint.py is the runtime entry for launching the API. This suggests the backend is intended to be deployed as a configurable service rather than embedded in the frontend.
8. Business-domain boundaries
The department packages reflect distinct operational domains: affirmation, education, evangelism, give grace, intercession, liberation, networks, visits, school, and new convert handling. Each one has its own resources and models, so the architecture is not a generic CRUD app; it is a multi-domain workflow system with department-specific data and permissions.
9. Email/notification subsystem
api/app/common/mail.py plus the HTML templates in api/app/templates/ show a notification pipeline. Templates cover events like student addition, assignments, attendance, retreat attendance, translation, unsubscribe, and workflow completion. This means the backend does more than store data: it also triggers outbound communication based on domain events.
10. Frontend/backend contract
The frontend’s department views and admin screens align closely with backend resource modules, suggesting a REST-style API contract keyed by domain. The UI focuses on operational tasks—listing people, assigning responsibilities, tracking attendance, creating activities—while the API owns persistence, validation, and notification side effects.
11. Tooling and runtime
The frontend uses the standard React build/test setup (package.json, public/, src/setupTests.js) and styling includes CSS plus tailwind.config.js. The backend is a Python application with explicit dependency management in api/requirements.txt. The repo therefore combines a modern SPA frontend with a structured Python service backend.
12. What to capture in an architecture diagram
A good diagram would show: browser users → React SPA → authenticated API calls → domain-based Python resources → database/models → email templates/notification delivery. Around that core, draw separate bounded domains for admin, auth, and each department, with shared infrastructure underneath and modal-driven user actions on the frontend side.
Main entry points: app Core Infra · App.js App Shell · mail.py Mail Service · pages Pages
Components 22
Frontend SPA
React browser app for authenticated and role-specific workflows.
- Users · People using the web app for admin and department workflows.
- App Shell · Top-level SPA composition and routing entry.
src/App.js - Pages · Route-level screens for home, admin, departments, new believer, and personal account.
src/pages - UI Components · Reusable layout, modal, and admin/department UI building blocks.
src/components - Department State · Centralized department state, actions, and data flow.
src/context/Departments - Access Guards · Authenticated and department-specific route gating.
src/components/ProtectedRoute.jsx - Dept Containers · Department-level containers that anchor each workflow area.
src/components/departments - Dept Views · Director and member views for department operations.
src/components/departments/afirmation - Modal Actions · Add, assign, inspect, and update flows driven by modal dialogs.
src/components/modal-content - Admin Screens · Admin management screens for users, departments, and activities.
src/pages/Admin.jsx
API Service
Python service with domain resources, models, and shared infrastructure.
- API Entry · Runtime entrypoint for starting the backend service.
api/entrypoint.py - Config · Environment-specific backend configuration for default, dev, and prod.
api/config - Core Infra · Database, extensions, and shared base models/schemas.
api/app - Auth · Authentication resources and API layer.
api/app/auth - Admin · Administrative resources for platform management.
api/app/admin - Departments API · Department resources and schemas for core operational data.
api/app/departments - Networks API · Networks and discipleship resources and models.
api/app/networks - New Convert API · New convert handling and related resources.
api/app/new_convert - School API · School-related resources and models.
api/app/school - Various API · Miscellaneous supporting resources and models.
api/app/various
Notifications
Outbound mail templates and delivery helpers.
- Mail Service · Email helper and template-based notification delivery.
api/app/common/mail.py - Mail Templates · Domain-event email templates for assignments, attendance, retreats, and workflow completion.
api/app/templates
Connections 25
- Users → App Shell: opens app · Users interact with the React SPA.
- App Shell → Pages: routes to · The SPA renders page-level screens.
- App Shell → UI Components: composes · Pages and layouts are built from shared UI components.
- Pages → Access Guards: protected by · Route screens are gated by auth and role checks.
- Pages → Dept Containers: mounts · Department pages load the relevant container.
- Dept Containers → Dept Views: hosts · Containers expose director and member workflows.
- Dept Views → Department State: reads/writes · Department views use centralized state for data loading and updates.
- Dept Views → Modal Actions: opens · Many actions are performed through modal dialogs.
- Admin Screens → Modal Actions: opens · Admin screens use modals for user and department operations.
- UI Components → Modal Actions: includes · Generic modal and domain-specific modal content live in shared components.
- App Shell → API Entry: calls API · Frontend submits authenticated requests to the backend service.
- API Entry → Config: loads · Runtime configuration selects environment-specific settings.
- API Entry → Core Infra: initializes · Service startup wires shared infrastructure.
- Core Infra → Auth: supports · Authentication uses shared models, schemas, and persistence.
- Core Infra → Admin: supports · Admin resources depend on shared infrastructure.
- Core Infra → Departments API: supports · Department resources depend on shared infrastructure.
- Core Infra → Networks API: supports · Networks resources depend on shared infrastructure.
- Core Infra → New Convert API: supports · New convert resources depend on shared infrastructure.
- Core Infra → School API: supports · School resources depend on shared infrastructure.
- Core Infra → Various API: supports · Miscellaneous resources depend on shared infrastructure.
- Departments API → Mail Service: triggers · Department events can generate outbound emails.
- Networks API → Mail Service: triggers · Network and discipleship events can generate notifications.
- New Convert API → Mail Service: triggers · New convert events can generate notifications.
- Mail Service → Mail Templates: renders · Notification content is assembled from HTML templates.
- Auth → App Shell: secures · Authentication underpins protected frontend access.