Multi-tenant educational management platform built with Angular 19 and Nx for Akademia's international organization. Features role-based access control (RBAC), real-time data synchronization, and comprehensive administrative tools for managing educational programs across multiple countries and headquarters.
This project leverages modern web technologies:
- Core Framework: Angular (v19) with standalone components & signals
- Monorepo Management: Nx (v20) for scalable architecture
- Backend/Database: Supabase (PostgreSQL + Auth + Realtime)
- UI Components: Taiga UI + Custom design system
- Styling: Tailwind CSS v4 with dark mode support
- Component Development: Storybook
- Internationalization: ngx-translate (EN/ES)
- Testing:
- Jest (Unit tests)
- Playwright (E2E tests)
- Code Quality:
- ESLint
- Prettier
- Husky (Git hooks)
- Commitizen (Semantic commits)
The project follows Nx's domain-driven monorepo architecture:
zambia/
βββ apps/
β βββ zambia/ # Main Angular application
β βββ zambia-e2e/ # End-to-end tests
βββ libs/
β βββ shared/ # Cross-application libraries
β β βββ data-access-auth/ # Authentication services & guards
β β βββ data-access-dashboard/ # Dashboard data management
β β βββ data-access-generic/ # Edge functions & utilities
β β βββ data-access-roles-permissions/ # RBAC implementation
β β βββ data-access-supabase/ # Database connection
β β βββ types-supabase/ # TypeScript types from DB
β β βββ ui-components/ # Reusable UI component library
β β βββ util-config/ # App configuration
β β βββ util-constants/ # Shared constants
β β βββ util-guards/ # Route guards
β β βββ util-roles-definitions/ # Role definitions
β βββ zambia/ # Feature modules
β βββ feat-agreements/ # Agreement management
β βββ feat-auth/ # Login/authentication
β βββ feat-countries/ # Country management
β βββ feat-dashboard/ # Main dashboard panel
β βββ feat-headquarter/ # HQ management
β βββ feat-homepage/ # Role-based homepage
β βββ feat-profile/ # User profile
β βββ feat-shell/ # App shell/layout
β βββ feat-students/ # Student analytics
β βββ feat-workshops/ # Workshop management
βββ docs/ # Project documentation
βββ database/ # SQL functions & migrations
βββ public/ # Static assets
This project supports different environment configurations for development and production.
IMPORTANT: The environment file structure has been updated to use root-level .env files instead of app-level files.
.env: Base environment variables shared across all environments.env.development: Development-specific environment variables (local development).env.production: Production-specific environment variables (deployment)
Example environment variables:
API_URL=https://api.yourdomain.com
API_PUBLIC_KEY=your-api-key
PROD=true/false
Environment template files are provided (.env.development.example and .env.production.example). Copy these to create your own environment files:
cp .env.development.example .env.development
cp .env.production.example .env.productionIf you previously had .env files in the apps/zambia directory, please move their contents to the corresponding root-level files.
-
Install dependencies:
npm ci
-
Generate environment files:
npm run config:dev
-
Start the development server:
npm run serve
The application will be available at http://localhost:4200.
For development with Docker (includes hot reloading):
npm run docker:devOr to rebuild the container:
npm run docker:dev:buildThe application will be available at http://localhost:4200.
To build the application for production locally:
npm run build:prodThe build output will be in dist/apps/zambia/browser/.
Build and run the production Docker image:
npm run docker:prod:buildThis will build the application with production configuration and serve it using Nginx on port 80.
To deploy to Coolify:
- Push your code to a Git repository
- In Coolify, connect to your repository
- Configure the environment variables in Coolify:
API_URLAPI_PUBLIC_KEYPROD=true
- Set the build command to use the Docker Compose file:
docker-compose up -d --build
Environment variables can be managed in three ways:
- Build-time variables: Defined in
.envfiles or passed as build arguments - Runtime variables: Passed to containers as environment variables
- Coolify variables: Set in the Coolify dashboard
The application has a runtime environment variable substitution mechanism for changing environment settings without rebuilding the application.
To visualize the project's dependency graph:
npm run graphThis will open the Nx dependency graph in your browser, showing the relationships between the different libraries and applications.
To run unit tests for the main application:
npm testTo run end-to-end tests:
npm run e2eTo format staged files:
npm run prettier:staged- Multi-level hierarchy: 50+ role levels with granular permissions
- Dynamic navigation: Menu items adapt based on user role
- Secure routes: Guard-protected pages with role verification
- Data filtering: Role-based data visibility at API level
- Authentication: Supabase Auth with JWT tokens
- Dashboard: Role-specific KPIs and analytics
- Agreement Management: Workflow for agreement approval
- Workshop Tracking: Schedule and monitor educational workshops
- Student Analytics: Progress tracking and demographics
- Multi-tenancy: Country and HQ-level data isolation
- Glass morphism: Modern glassmorphic design patterns
- Dark mode: Full dark/light theme support
- Responsive: Mobile-first responsive design
- i18n: English/Spanish translations
- Accessible: WCAG compliance focus
// β
Use standalone components
@Component({
selector: 'z-example',
standalone: true,
imports: [CommonModule],
template: `...`
})
// β
Use signals for state
isLoading = signal(false);
data = computed(() => this.items().filter(item => item.active));
// β
Use new control flow
@if (condition) { }
@for (item of items; track item.id) { }
// β
Use inject() for DI
private service = inject(MyService);- Smart Components:
*.smart-component.ts(containers) - UI Components:
*.ui-component.ts(presentational) - Services:
*-facade.service.ts(feature facades) - Files: kebab-case throughout
# Use semantic commits
npm run cm
# Automatic formatting on commit
git add .
git commit # Husky will run linting/formatting# Development
npm run dev # Start dev server
npm run build # Production build
npm run test # Run unit tests
npm run e2e # Run E2E tests
npm run lint:all # Lint entire workspace
npm run graph # View dependency graph
# Code Generation
npx nx g @nx/angular:library --name=feat-[name] --directory=libs/zambia
npx nx g @nx/angular:component --name=[name] --type=smart-component
# Docker Operations
npm run docker:dev # Dev with hot reload
npm run docker:prod:build # Production build- CLAUDE.md - AI assistant instructions
- Development Guide - Detailed dev setup
- Angular Guidelines - Angular best practices
- Database Schema - Supabase structure
- Dashboard Analysis - Feature analysis
The application is designed for deployment on various platforms:
- Coolify: Self-hosted PaaS deployment
- Vercel: Edge deployment with SSR support
- Docker: Containerized deployment anywhere
- Traditional: Nginx static hosting
See deployment documentation for detailed instructions.
- Follow the semantic commit convention
- Ensure all tests pass
- Update documentation as needed
- Submit PR with clear description