How mywhitecow/codeforge works
1. Repository shape
- This is a two-app monorepo: a Laravel backend in backend/api-lumina and an Angular frontend in frontend/web-lumina.
- The backend and frontend are separated by a clear HTTP boundary; the frontend consumes the backend as an API.
2. Overall product architecture
- The README describes CodeForge Academy / Lumina as an e-learning subscription platform.
- In the current codebase, the implemented foundation is primarily authentication and application scaffolding, not the full course/subscription domain yet.
3. Backend role
- The Laravel app acts as the REST API server.
- It exposes application behavior through routes/api.php and routes/web.php, with AuthController.php currently the only visible custom controller.
- Laravel’s standard bootstrap, config, and artisan structure are present, so this is a conventional request/response backend.
4. Backend domain model
- The main domain entities visible in the backend are User and Role.
- Migrations include users, roles, cache, jobs, and personal access tokens, which suggests the backend is prepared for:
- authenticated users,
- role-based access control,
- token-based API authentication,
- queued/background work,
- caching.
5. Authentication boundary
- The backend uses Laravel Sanctum (config/sanctum.php and personal access token migration), indicating API authentication is token-oriented rather than session-only.
- AuthController is the likely entry point for login/register/logout or token issuance flows.
- The User model is the central authenticated principal; Role suggests authorization is meant to extend beyond simple user login.
6. Persistence layer
- The system persists data in PostgreSQL, as documented in the README and reflected in the Laravel database configuration.
- Database migrations are the source of schema truth; seeders/factories are present for local development and test data.
7. Frontend role
- The Angular app is the user-facing client and likely the primary interaction surface for the platform.
- src/app/services/api.ts is the obvious integration point where the frontend centralizes calls to the Laravel API.
- environment.ts / environment.development.ts suggest API base URLs and environment-specific settings are externalized.
8. Frontend rendering model
- The Angular project includes main.server.ts, app.config.server.ts, and app.routes.server.ts, which indicates server-side rendering support or a hybrid rendering setup, not just a pure client-side SPA.
- server.ts is the Node-side entry used to serve the Angular app in SSR mode.
9. Frontend application structure
- The frontend is organized around a root app component and route configuration (app.ts, app.routes.ts, app.config.ts).
- This implies a route-driven UI with shared configuration and a dedicated service layer for API access.
10. Request/data flow
- Typical flow is: browser or server-rendered Angular app → api.ts service → Laravel API controller(s) → Eloquent models → PostgreSQL.
- Authentication flow likely adds: Angular client → Laravel/Sanctum token issuance → token stored client-side → subsequent authenticated API calls.
11. Operational/runtime boundaries
- The backend runs as a PHP/Laravel service (php artisan serve in local dev).
- The frontend runs as a Node/Angular application (ng serve), with SSR-capable Node entrypoints present.
- These are independently runnable services, which is important for diagramming deployment boundaries.
12. Auxiliary infrastructure
- Laravel includes queues, cache, sessions, and storage directories, so the backend is prepared for standard platform concerns beyond simple CRUD.
- storage/ and public/ follow Laravel’s conventional split between persisted files and HTTP-facing assets.
13. Current maturity signal
- The repo is at an early platform stage: strong foundation for identity, authorization, and app scaffolding, but no visible course/catalog/payment modules yet.
- An architecture diagram should therefore emphasize the platform skeleton rather than mature business workflows.
Main entry points: AuthController.php Auth controller · app.ts Angular app · api.php API routes · migrations Migrations
Components 16
Laravel API
PHP backend providing authentication and REST endpoints.
- Laravel app · Laravel runtime and application bootstrap for the backend.
backend/api-lumina - API routes · Defines backend HTTP entry points and request dispatch.
backend/api-lumina/routes/api.php - Auth controller · Custom controller for login/register/logout or token issuance.
backend/api-lumina/app/Http/Controllers/AuthController.php - User model · Primary authenticated principal in the backend.
backend/api-lumina/app/Models/User.php - Role model · Represents role-based access control in the backend.
backend/api-lumina/app/Models/Role.php - Sanctum · Token-based API authentication configuration and personal access tokens.
backend/api-lumina/config/sanctum.php - Migrations · Database schema definitions and local data scaffolding.
backend/api-lumina/database/migrations - Queue/cache · Prepared support for background jobs, caching, and sessions.
backend/api-lumina/config/queue.php - Bootstrap · Laravel bootstrap, service providers, and environment wiring.
backend/api-lumina/bootstrap/app.php
Angular Web
User-facing Angular app with SSR support.
- Angular app · Angular application shell and route-driven UI.
frontend/web-lumina/src/app/app.ts - Routes · Client-side route configuration for the Angular app.
frontend/web-lumina/src/app/app.routes.ts - App config · Shared application configuration for browser and server runtime.
frontend/web-lumina/src/app/app.config.ts - API service · Centralized frontend service for calling the Laravel API.
frontend/web-lumina/src/app/services/api.ts - Environments · Environment-specific API base URLs and client settings.
frontend/web-lumina/src/environments/environment.ts - SSR entry · Node-side entrypoints for server-side rendering or hybrid serving.
frontend/web-lumina/src/server.ts
Persistence
Database and schema-related assets.
- PostgreSQL · Primary relational datastore for application state.
Connections 18
- Laravel app → Bootstrap: boots with · Laravel application starts through framework bootstrap and providers.
- Laravel app → API routes: serves · HTTP requests are dispatched through route definitions.
- API routes → Auth controller: maps to · Authentication endpoints are handled by the custom controller.
- Auth controller → Sanctum: issues tokens · Authentication flow uses Sanctum personal access tokens.
- Auth controller → User model: reads/writes · Auth operations center on the User principal.
- Auth controller → Role model: checks roles · Authorization is expected to incorporate roles.
- User model → Migrations: persisted by · User schema is defined through migrations.
- Role model → Migrations: persisted by · Role schema is defined through migrations.
- Sanctum → Migrations: stores tokens · Personal access tokens are stored in the database.
- Migrations → PostgreSQL: applies to · Migrations materialize schema in PostgreSQL.
- Laravel app → Queue/cache: uses infra · Backend is prepared for cache, sessions, and queued work.
- Angular app → Routes: navigates by · UI is organized around client-side routes.
- Angular app → App config: configured by · Shared app configuration is provided to the Angular runtime.
- Angular app → API service: calls · User actions and data loading flow through the API service.
- API service → Environments: reads settings · API base URL and environment values come from environment files.
- SSR entry → Angular app: renders · SSR entrypoints serve the Angular application on the server side.
- API service → API routes: HTTP requests · Frontend consumes the Laravel API over the network boundary.
- SSR entry → API routes: server-side requests · SSR/hybrid runtime can also fetch backend data server-side.