A volleyball coaching platform for scheduling and managing private lessons, group lessons, and athlete registrations. Built with Next.js and deployed on Azure.
Live Site: https://allirustvb.com
- Overview
- Tech Stack
- Architecture
- Project Structure
- Local Development
- Environment Variables
- Testing
- Deployment
- Infrastructure
This platform provides:
- Public-facing landing page with coaching services
- Private lesson booking and management
- Group lesson scheduling with athlete registration
- Admin dashboard for coaches (Azure AD authenticated)
- Email notifications via Resend
- Calendar views for lesson scheduling
- Framework: Next.js 15.5+ (App Router)
- React: 19.0
- Styling: Tailwind CSS 4
- UI Components: React Icons, React Big Calendar, React Day Picker
- Date Utilities: date-fns
- Runtime: Node.js
- API: Next.js API Routes
- Authentication: NextAuth.js with Azure AD
- Database: Azure Cosmos DB
- Email: Resend
- Infrastructure as Code: Terraform
- Cloud Provider: Microsoft Azure
- Testing: Jest with React Testing Library
- Linting: ESLint
The application follows a serverless architecture deployed on Azure:
┌─────────────────┐
│ Next.js App │
│ (Azure Hosted) │
└────────┬────────┘
│
├─────────────┐
│ │
┌────▼─────┐ ┌───▼──────┐
│ Cosmos DB │ │ Azure AD │
│ (NoSQL) │ │ (Auth) │
└───────────┘ └──────────┘
│
┌────▼─────┐
│ Resend │
│ (Email) │
└──────────┘
Data Models:
GroupLesson- Group training sessionsPrivateLesson- One-on-one coachingAthlete- Registered participantsGroupRegistration- Athlete enrollment in group lessons
API Routes:
/api/group-lesson- CRUD operations for group lessons/api/private-lesson- CRUD operations for private lessons/api/register-athlete- Athlete registration/api/contact- Contact form submissions/api/auth/[...nextauth]- Authentication endpoints
Authentication:
- Admin pages protected via NextAuth.js middleware
- Azure AD integration for coach login
allirustvb.com/
├── src/app/ # Next.js application (main codebase)
│ ├── app/ # Next.js App Router pages
│ │ ├── api/ # API route handlers
│ │ ├── admin/ # Protected admin pages
│ │ └── page.tsx # Landing page
│ ├── components/ # React components
│ ├── lib/ # Utility libraries
│ │ ├── auth.ts # NextAuth configuration
│ │ ├── cosmosdb.ts # Database client
│ │ └── sendEmail.ts # Email service
│ ├── models/ # TypeScript data models
│ ├── utils/ # Helper functions
│ └── middleware.ts # Auth middleware
├── infra/azure/ # Terraform infrastructure
│ └── rln01/ # Azure subscription config
├── test/ # Test infrastructure
├── tvac_court_schedule/ # Court scheduling data
└── README.md
- Node.js 20+
- npm or yarn
- Azure Cosmos DB account (or Azure Cosmos DB Emulator)
- Azure AD tenant for authentication
- Clone the repository:
git clone https://github.com/mitchellrust/allirustvb.com.git
cd allirustvb.com- Navigate to the app directory:
cd src/app- Install dependencies:
npm install-
Configure environment variables (see Environment Variables)
-
Start the development server:
npm run devThe app will be available at http://localhost:3000
npm run dev # Start dev server with Turbopack
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm test # Run Jest tests
npm run test:watch # Run tests in watch modeCreate a .env.local file in src/app/ with the following variables:
# Azure Cosmos DB
COSMOSDB_ENDPOINT=https://your-account.documents.azure.com:443/
COSMOSDB_KEY=your-primary-key
COSMOSDB_DATABASE_ID=your-database-name
# Azure AD Authentication
AZURE_AD_CLIENT_ID=your-client-id
AZURE_AD_CLIENT_SECRET=your-client-secret
AZURE_AD_TENANT_ID=your-tenant-id
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
# Resend Email
RESEND_API_KEY=your-resend-api-keyThe project uses Jest with React Testing Library for testing.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm test -- --coverageTest files are located in src/app/__tests__/
The application is deployed on Azure using Terraform for infrastructure management.
- Azure CLI installed and authenticated
- Terraform 1.x installed
- Access to the target Azure subscription
cd infra/azure/rln01
terraform init
terraform plan
terraform applyThe Next.js application can be deployed to:
- Azure Static Web Apps
- Azure App Service
- Vercel (alternative)
Environment variables must be configured in the deployment environment.
Infrastructure is defined in Terraform under infra/azure/rln01/:
Resources:
- Resource Group:
rln01rgp-tfstate-nonprod - Storage Account:
rln01strtfstatenonprod(Terraform state) - Cosmos DB Account: (defined in
allirustvbcom.tf) - Azure AD App Registration: For authentication
State Management:
- Terraform state stored in Azure Blob Storage
- Backend configuration in
main.tf
Built with Next.js | Deployed on Azure | Powered by Cosmos DB