A comprehensive, multi-tenant sport club management SAAS platform built with .NET 9, Blazor WASM, and modern web technologies.
- Schema-per-tenant isolation for complete data separation
- Custom domains and branding per tenant
- Flexible subscription plans with usage limits
- Member registration and profile management
- Membership tiers and renewal tracking
- Emergency contacts and medical information
- Custom fields per tenant
- Custom facility types with configurable properties
- Real-time availability and booking system
- Operating hours and capacity management
- Maintenance scheduling
- Custom equipment categories with dynamic attributes
- Member equipment assignments with tracking
- Maintenance logs and replacement planning
- Usage history and analytics
- Recurring classes and one-time events
- Staff can register members for classes
- Capacity management and waitlists
- Instructor assignments
- Stripe integration for subscriptions and one-time payments
- Automated billing and invoice generation
- Refund processing and payment tracking
- Blazor WASM with MudBlazor Material Design components
- Progressive Web App (PWA) ready
- Responsive design for all devices
- Real-time updates and notifications
- ASP.NET Core Web API with JWT authentication
- Entity Framework Core with PostgreSQL
- Clean Architecture (Domain, Application, Infrastructure)
- MediatR for CQRS pattern
- FluentValidation for input validation
- MudBlazor UI component library
- Progressive Web App capabilities
- Real-time communication ready
- Responsive Material Design
- PostgreSQL with schema-per-tenant multi-tenancy
- Redis for caching and session management
- MinIO for file storage (S3-compatible)
- Docker containerization with docker-compose
- Stripe for payment processing
- Email/SMS notifications (configurable)
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Blazor WASM β β ASP.NET API β β PostgreSQL β
β (Port 4002/3) βββββΊβ (Port 4000/1) βββββΊβ (Port 4004) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ β
βββββββββββββββββββ βββββββββββββββββββ β
β Redis β β MinIO β β
β (Port 4007) β β (Port 4005/6) β β
βββββββββββββββββββ βββββββββββββββββββ β
β
Schema per Tenant ββββββββββ
βββ tenant1_schema
βββ tenant2_schema
βββ demo_club (demo)
- .NET 9 SDK
- Docker & Docker Compose
- Git
git clone <repository-url>
cd ClubManagement
# Interactive setup (recommended)
./scripts/setup.sh
# OR quick setup with defaults (for development)
./scripts/setup.sh --quickπ§ Interactive Setup (Default)
- Prompts for database, Redis, MinIO passwords
- Uses existing
.envvalues as defaults if present - Generates secure JWT key automatically
- Best for production or when you need custom configuration
π Quick Setup (--quick)
- Uses default values from
.env.sample - Uses existing
.envvalues if present - No interactive prompts
- Perfect for development and testing
The setup script will:
- β Check prerequisites (.NET 9, Docker, Docker Compose)
- π§ Interactive configuration for passwords and settings
- βοΈ Generate
config.jsonfrom template using.envvalues - π³ Start Docker services (PostgreSQL, Redis, MinIO)
- π Initialize database with demo data
- π Generate HTTPS certificates
For production or enhanced security, generate a secure JWT key:
# Generate a cryptographically secure JWT secret
./scripts/generate-jwt-secret.sh
# This will optionally update your .env file automaticallyOption A: Local Development (Recommended)
# Start infrastructure only (PostgreSQL, Redis, MinIO)
./scripts/start-infra.sh
# Run API locally (Terminal 1)
cd src/Api/ClubManagement.Api
dotnet run
# Run Client locally (Terminal 2)
cd src/Client/ClubManagement.Client
dotnet runOption B: Full Docker
# Start everything in containers
docker-compose up -d- π API: https://localhost:4001
- π¨ Client: https://localhost:4003
- ποΈ PostgreSQL: localhost:4004
- π¦ Redis: localhost:4007
- πΎ MinIO Console: http://localhost:4006
- Domain:
demo.localhost - Database Schema:
demo_club
Demo Admin Account:
- Email:
admin@demo.localhost - Password:
Admin123! - Role: Administrator (full system access)
Demo Member Account:
- Email:
member@demo.localhost - Password:
Member123! - Role: Member (member portal access)
- Membership: Basic tier, active status
Demo Coach Account:
- Email:
coach@demo.localhost - Password:
Coach123! - Role: Coach (coaching and training access)
- Purpose: For trainers, instructors, and coaching staff
ClubManagement/
βββ src/
β βββ Shared/ # Shared models and DTOs
β βββ Domain/ # Domain entities and interfaces
β βββ Application/ # Business logic and CQRS
β βββ Infrastructure/ # Data access and external services
β βββ Api/ # ASP.NET Core Web API
β β βββ config.sample.json # Configuration template
β βββ Client/ # Blazor WASM frontend
βββ scripts/
β βββ setup.sh # Main setup script
β βββ generate-docker-config.sh # Docker configuration generator
β βββ init-db.sql # Database initialization
βββ docker-compose.yml # Docker services configuration
βββ .env.sample # Environment variables template
βββ README.md
- π Template:
.env.samplecontains all required environment variables - π Generation:
setup.shcopies.env.sampleβ.env(first run only) - βοΈ Customization: Edit
.envwith your specific values - βοΈ Build: Script generates
config.jsonfrom template using.envvalues - π Runtime: Application loads
config.jsonfor all configuration
# Database Configuration
POSTGRES_HOST=localhost
POSTGRES_PORT=4004
POSTGRES_DB=clubmanagement
POSTGRES_USER=clubadmin
POSTGRES_PASSWORD=clubpassword
# JWT Authentication
JWT_SECRET_KEY=YourSuperSecretKey...
JWT_ISSUER=ClubManagement
JWT_AUDIENCE=ClubManagement
# External Services
REDIS_HOST=localhost
REDIS_PORT=4007
MINIO_ENDPOINT=localhost:4005
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Application URLs
API_BASE_URL=https://localhost:4001
CLIENT_BASE_URL=https://localhost:4003.env.sampleβ Template with default values.envβ Your actual configuration (git-ignored)config.sample.jsonβ Template with placeholders like{{DB_HOST}}config.jsonβ Generated configuration (git-ignored)
docker-compose up -d- Update
.envwith production values - Update Stripe keys and JWT secrets
- Configure custom domain and SSL certificates
- Deploy with:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d- Public Schema: Tenant management and authentication
- Tenant Schemas: Isolated data per tenant (e.g.,
demo_club,tenant_abc)
users- User accounts and profilesmembers- Club member informationfacility_types- Custom facility categoriesfacilities- Facility instances with dynamic propertieshardware_types- Equipment categorieshardware- Equipment instances with assignmentsevents- Classes and eventspayments- Stripe payment records
- Domain: Add entities to
src/Domain/ - Application: Add commands/queries to
src/Application/ - Infrastructure: Add data access to
src/Infrastructure/ - API: Add controllers to
src/Api/Controllers/ - Client: Add pages/components to
src/Client/
# Add migration
dotnet ef migrations add MigrationName --project src/Infrastructure/ClubManagement.Infrastructure --startup-project src/Api/ClubManagement.Api
# Update database
dotnet ef database update --project src/Infrastructure/ClubManagement.Infrastructure --startup-project src/Api/ClubManagement.Api# Build and test
dotnet build
dotnet test- JWT Authentication with refresh tokens
- Multi-tenant data isolation via database schemas
- CORS protection with configurable origins
- Input validation with FluentValidation
- SQL injection protection with parameterized queries
- HTTPS enforcement in production
All services include health check endpoints:
- API:
/health - PostgreSQL: Built-in health checks
- Redis:
redis-cli ping - MinIO:
/minio/health/live
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: support@clubmanagement.com
- π¬ GitHub Issues: For bug reports and feature requests
- π Documentation: Check the
/docsfolder for detailed guides
Built with β€οΈ using .NET 9, Blazor WASM, and MudBlazor