Skip to content

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)
Email 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

  1. Clone the repository
git clone <repository-url>
cd coaching-app
  1. Copy environment files
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
  1. Install dependencies
pnpm install
  1. Start all services
docker compose -f docker-compose.yml -f docker-compose.dev.yml up
  1. Run migrations and seed
cd backend && pnpm db:migrate && pnpm db: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 Email 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

Architecture

Development

Features

Guides

Operations

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.