Coaching App¶
A modern coaching platform built as a monorepo with a Hono + Drizzle backend and a unified Expo multi-platform app supporting web, iOS, and Android with role-based access control.
ποΈ Tech Stack¶
| Layer | Technology |
|---|---|
| Backend | Hono + Drizzle ORM + Better-auth |
| Frontend | Expo β web, iOS, Android |
| Database | PostgreSQL 16 |
| Cache | Redis 7 |
| Storage | MinIO (S3-compatible) |
| Nodemailer via Mailpit (dev) / SMTP (prod) | |
| Package Manager | pnpm workspaces |
| Containers | Docker Compose |
π Project Structure¶
coaching-app/
βββ backend/ # Hono API server
β βββ src/
β β βββ db/ # Drizzle schema + migrations
β β βββ middleware/ # Auth, role-guard, tenant
β β βββ routes/ # Hono routers per resource
β β βββ services/ # Business logic
β β βββ lib/ # Better-auth setup
β βββ drizzle/ # Migration files
β βββ __tests__/ # Integration tests
βββ frontend/ # Expo multi-platform app
β βββ src/
β βββ components/ # Shared components (RoleGuard)
β βββ contexts/ # Auth + React Query providers
β βββ hooks/ # useAuth, usePermissions
β βββ lib/ # API client, secure storage
β βββ navigation/ # Platform-specific navigation
β βββ screens/ # App screens by role
β βββ store/ # Zustand auth store
βββ shared/ # Shared TypeScript types and utilities
βββ docs/ # MkDocs documentation site
π Role-Based Access Control¶
| Role | Access |
|---|---|
| Platform Admin | All organizations, system-wide management |
| Organization Admin | Manage users within assigned organization |
| Manager | Full access within organization |
| Coach | Own sessions and assigned bookings |
| Teacher | Browse and book sessions |
Permissions are enforced at both the frontend (RoleGuard) and backend (middleware) levels.
π Quick Start¶
Prerequisites¶
Development Setup¶
- Clone the repository
- Copy environment files
- Install dependencies
- Start all services
- Run migrations and seed
Service URLs¶
| Service | URL |
|---|---|
| Backend API | http://localhost:3001 |
| Frontend (web) | http://localhost:8081 |
| MinIO Console | http://localhost:9001 |
| Mailpit | http://localhost:8025 |
| Drizzle Studio | http://localhost:4983 |
Default Credentials¶
Security Warning
Change all credentials before deploying to production.
Sample accounts created by seed script:
| Role | Password | |
|---|---|---|
| Platform Admin | platformadmin@coaching.test |
PlatformAdmin1234! |
| Org Admin | orgadmin@coaching.test |
Admin1234! |
| Manager | manager@coaching.test |
Manager1234! |
| Coach | coach@coaching.test |
Coach1234! |
| Teacher | teacher@coaching.test |
Teacher1234! |
The seed script also creates demo mentorships, sample sessions, and attachment records so the default coach and teacher accounts have data to explore immediately after pnpm db:seed.
π§ͺ Running Tests¶
# All tests
pnpm test
# Watch mode
pnpm test:watch
# Coverage report
pnpm test:coverage
# Backend only
pnpm workspace @coaching-app/backend test
# Frontend only
pnpm workspace @coaching-app/frontend test
Coverage threshold: 70% enforced across branches, functions, lines, and statements.
π Documentation¶
Getting Started¶
- Developer Onboarding β New developer setup checklist
- Contributing β Contribution guidelines
Architecture¶
- System Architecture β Design and component interactions
- Security β Security best practices
Development¶
- Development Workflow β Docker setup and day-to-day workflow
- Testing Strategy β Testing strategy and coverage
- Code Quality β Linting, formatting, TypeScript
Features¶
- API Endpoints β Backend route reference
- Permissions & Roles β RBAC implementation
- Schema Management β Drizzle migrations
- Shared Types β TypeScript type definitions
- Password Reset β Password reset flow
Guides¶
- UI Styling Guide β NativeWind styling patterns
Operations¶
- Deployment β Production deployment guide
- Cloudflare Zero Trust β Rate limiting, DDoS protection, and app authentication
Project¶
- Roadmap β Planned features and improvements
π€ Contributing¶
See Contributing Guide for commit conventions and PR process.
π License¶
This project is proprietary software. See LICENSE for details.