Skip to content

Website for Alli for coaching information, and lesson signups/scheduling.

Notifications You must be signed in to change notification settings

mitchellrust/allirustvb.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

150 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

allirustvb.com

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

Table of Contents

Overview

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

Tech Stack

Frontend

  • 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

Backend

  • Runtime: Node.js
  • API: Next.js API Routes
  • Authentication: NextAuth.js with Azure AD
  • Database: Azure Cosmos DB
  • Email: Resend

DevOps

  • Infrastructure as Code: Terraform
  • Cloud Provider: Microsoft Azure
  • Testing: Jest with React Testing Library
  • Linting: ESLint

Architecture

The application follows a serverless architecture deployed on Azure:

┌─────────────────┐
│   Next.js App   │
│  (Azure Hosted) │
└────────┬────────┘
         │
         ├─────────────┐
         │             │
    ┌────▼─────┐  ┌───▼──────┐
    │ Cosmos DB │  │ Azure AD │
    │ (NoSQL)   │  │  (Auth)  │
    └───────────┘  └──────────┘
         │
    ┌────▼─────┐
    │  Resend  │
    │ (Email)  │
    └──────────┘

Key Components

Data Models:

  • GroupLesson - Group training sessions
  • PrivateLesson - One-on-one coaching
  • Athlete - Registered participants
  • GroupRegistration - 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

Project Structure

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

Local Development

Prerequisites

  • Node.js 20+
  • npm or yarn
  • Azure Cosmos DB account (or Azure Cosmos DB Emulator)
  • Azure AD tenant for authentication

Setup

  1. Clone the repository:
git clone https://github.com/mitchellrust/allirustvb.com.git
cd allirustvb.com
  1. Navigate to the app directory:
cd src/app
  1. Install dependencies:
npm install
  1. Configure environment variables (see Environment Variables)

  2. Start the development server:

npm run dev

The app will be available at http://localhost:3000

Development Commands

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 mode

Environment Variables

Create 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-key

Testing

The 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 -- --coverage

Test files are located in src/app/__tests__/

Deployment

The application is deployed on Azure using Terraform for infrastructure management.

Prerequisites

  • Azure CLI installed and authenticated
  • Terraform 1.x installed
  • Access to the target Azure subscription

Deploy Infrastructure

cd infra/azure/rln01
terraform init
terraform plan
terraform apply

Deploy Application

The 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

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

About

Website for Alli for coaching information, and lesson signups/scheduling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published