Skip to content

jerryboganda/famev2

Repository files navigation

FAME v2 — First Aid Made Easy

Modern, secure, high-performance medical exam preparation LMS.

Tech Stack

Layer Technology
Frontend Next.js 15, TypeScript, Tailwind CSS 4, Radix UI
Backend ASP.NET Core (.NET 10), C# 14, Modular Monolith
Database PostgreSQL 17, EF Core, Code-First
Cache Redis 7
Search Meilisearch
Email Brevo
Storage Cloudflare R2 (S3-compatible)
Logging Serilog → Seq
CI/CD GitHub Actions
Deployment Docker Compose on Ubuntu VPS

Quick Start

Prerequisites

  • .NET 10 SDK
  • Node.js 22+
  • Docker & Docker Compose

1. Clone and start infrastructure

git clone https://github.com/your-org/fame-v2.git
cd fame-v2
docker compose up -d postgres redis meilisearch seq

2. Start the API

cd src/FAME.Api
dotnet run

API runs at http://localhost:5000. Swagger at http://localhost:5000/swagger.

3. Start the frontend

cd packages/web
cp .env.example .env.local    # Already configured for localhost
npm install
npm run dev

Frontend runs at http://localhost:3000.

4. Seed Development Data (optional)

cd tools/FAME.Seeder
dotnet run

Seeds 10 exam tracks, 20 courses, 200 MCQs, 20 exams, demo users, subscription plans, and content.

Demo credentials:

Role Email Password
Admin admin@firstaidmadeeasy.com.pk Admin@Fame2026!
Instructor instructor@demo.fame.pk Instructor@2026!
Student fatima@demo.fame.pk Student@2026!

5. View logs

Open Seq at http://localhost:5341.

Infrastructure services:

Service Port URL
PostgreSQL 5432
Redis 6379
Meilisearch 7700 http://localhost:7700
Seq (logs) 5341 http://localhost:5341
MailHog SMTP 1025
MailHog UI 8025 http://localhost:8025

Project Structure

fame-v2/
├── src/
│   ├── FAME.Api/              # API host (composition root)
│   ├── FAME.SharedKernel/     # Base entities, Result<T>, value objects
│   ├── FAME.Infrastructure/   # EF Core, Redis, Email, Storage, Jobs
│   └── Modules/
│       ├── Identity/          # Auth, registration, profiles, roles
│       ├── Catalog/           # Exam tracks, courses, lectures
│       ├── Assessment/        # MCQ engine, exams, results
│       ├── Enrollment/        # Subscriptions, access, progress
│       ├── Payment/           # JazzCash, Easypaisa, Stripe
│       ├── Communication/     # Notifications, tickets, email
│       ├── Certificate/       # Issuance, verification
│       ├── Ambassador/        # Referrals, commissions
│       ├── Content/           # CMS, blog, FAQs
│       ├── Analytics/         # Audit logs, dashboards
│       └── Admin/             # Admin aggregation
├── packages/
│   └── web/                   # Next.js 15 frontend
├── tests/
│   ├── FAME.UnitTests/
│   ├── FAME.IntegrationTests/
│   └── FAME.ArchitectureTests/
├── tools/
│   ├── FAME.Migrator/         # V1 → V2 data migration ETL
│   └── FAME.Seeder/           # Development seed data
├── ops/                       # Monitoring, backup scripts
├── docs/                      # Architecture documentation
└── docker-compose.yml

Architecture

  • Modular Monolith with vertical slice architecture
  • CQRS-light via MediatR (Command/Query separation)
  • Result pattern for explicit error handling (no exceptions for expected failures)
  • Domain events dispatched after SaveChanges via EF Core interceptors
  • Policy-based authorization with 8 roles
  • Keyset pagination for all list endpoints
  • Guid v7 primary keys (time-sortable)
  • Soft delete with global query filters

Modules

Each module follows the vertical slice pattern:

Module/
├── Domain/         # Entities, enums, domain events
├── Features/       # Command/Query + Handler + Validator + Endpoint
├── Infrastructure/ # EF Core configurations
└── ModuleExtensions.cs  # DI registration

Development

# Build entire solution (18 projects)
dotnet build FAME.slnx

# Run all tests
dotnet test FAME.slnx

# Run unit tests (75 tests across SharedKernel, Catalog, Assessment, Enrollment, Payment)
dotnet test tests/FAME.UnitTests

# Run architecture tests (module boundary + naming conventions)
dotnet test tests/FAME.ArchitectureTests

# Run integration tests (requires Docker for Testcontainers)
dotnet test tests/FAME.IntegrationTests

# Frontend type check + lint
cd packages/web && npm run type-check && npm run lint

# Full Docker stack
docker compose up -d

Roles

Role Access
SuperAdmin Full system access
Admin User/content/payment management
AcademicManager Content + assessment management
ContentEditor Course/lecture editing
SupportAgent Tickets + read-only users
FinanceStaff Payments + refunds
Instructor Own courses + student interaction
Student Learning + exams + profile

Production Deployment

Option A: Docker Compose (Recommended)

# 1. Configure environment
cp .env.production.example .env
# Edit .env with real secrets (DB passwords, JWT secret, SMTP, etc.)

# 2. Deploy with build
./ops/deploy.sh --build

# 3. Verify health
curl https://firstaidmadeeasy.com.pk/api/health
curl https://api.firstaidmadeeasy.com.pk/health

Option B: Manual Deployment

  1. Build frontend: cd packages/web && npm run build
  2. Build API: cd src/FAME.Api && dotnet publish -c Release
  3. Configure Nginx: copy ops/nginx/fame-v2.conf to /etc/nginx/sites-available/
  4. Set up SSL: certbot --nginx -d firstaidmadeeasy.com.pk -d api.firstaidmadeeasy.com.pk
  5. Start services via systemd

Nginx Configuration

Production Nginx config is at ops/nginx/fame-v2.conf and includes:

  • HTTP → HTTPS redirect
  • TLS 1.2/1.3 with modern cipher suite
  • Security headers (HSTS, X-Frame-Options, CSP, etc.)
  • Gzip compression for text/CSS/JS/JSON/SVG
  • Static asset caching (365 days for _next/static/)
  • WebSocket support for SignalR
  • Separate server block for API subdomain

Docker Production Override

docker-compose.prod.yml adds resource limits, PostgreSQL tuning, Redis eviction policy, and JSON file logging.

docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d

Frontend Features (28 pages)

Student Portal

  • Dashboard with stats, recent courses, upcoming exams
  • Course catalog with search and filters
  • Video lecture player with progress tracking
  • MCQ exam engine (timed/tutor modes, strike-through, flagging)
  • Detailed exam results with topic-level breakdown
  • Auto-generated certificates with public verification
  • Real-time notifications via SignalR
  • Profile management with avatar upload
  • Support ticket system with threaded replies
  • Full-text search across courses, exams, content

Admin Panel (14 pages)

Dashboard, Courses, Exam Tracks, Users, Payments, Blog, FAQs, CMS Pages, Certificate Templates, Announcements, Audit Logs, Feature Flags, Subscription Plans, Enrollments

Public Pages

Landing page, Course catalog, Exam browser, Pricing, Blog, FAQ, Certificate verification

Ambassador Dashboard

Referral stats, earnings tracking, link management


Git Commits (25 weeks)

Week Description
1-2 Monorepo scaffold, Docker Compose, .NET API scaffold
3-4 Auth module (JWT), Catalog module (courses, exam tracks)
5-6 Assessment (MCQs, exams), Enrollment, Payment, Notification
7-8 Content (blog, FAQ, CMS), Analytics, Feature flags, Search
9-10 API hardening, Health checks, Frontend scaffold
11-12 Auth UI, Student dashboard, Course catalog, Exam browser
13-14 Exam taking, Results, Course learning, Checkout, Pricing
15-16 SignalR notifications, Profile, File uploads, Tickets
17-18 Full-text search, Course player, Onboarding, Settings
19-20 Admin CRUD, Blog, FAQ, Certificates, Verification
21-22 Admin content management, Certificate templates, Announcements
23-24 Admin audit logs, Feature flags, Plans, Enrollments
25+ Production readiness: SEO, error handling, deployment config

License

Proprietary — First Aid Made Easy © 2026

About

famev2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages