Multi-tenant gym management platform with AI-powered workout generation
# Clone the repository
git clone https://github.com/alejandro-albiol/athenai.git
cd athenai
# Setup environment
cp example.env .env
# Edit .env with your database configuration
# Install dependencies and start development server
go mod tidy
air # or: go run ./cmd/main.goAccess the application:
- 🌐 Frontend: http://localhost:8080
- 📡 API: http://localhost:8080/api/v1
- 📚 API Docs: http://localhost:8080/swagger-ui
AthenAI is a comprehensive gym management platform featuring:
- 🏢 Multi-Tenant Architecture: Complete data isolation per gym
- 🤖 AI Workout Generation: Smart workout creation based on user goals
- 👥 User Management: Role-based access for admins, trainers, and members
- 💪 Exercise Library: Extensive catalog with custom gym additions
- 📊 Workout Tracking: Complete workout history and progress monitoring
- 🔐 Secure Authentication: JWT-based auth with tenant isolation
- Go: 1.19 or higher
- PostgreSQL: Database for multi-tenant data storage
- Air (optional): For live reload development
# Install Air for live reload
go install github.com/air-verse/air@latest# Database setup
go run ./cmd/setup-db/main.go
# Create superadmin (platform administrator)
go run ./cmd/setup-superadmin/main.go# Development with live reload
air
# Production build
go build -o bin/athenai ./cmd
# Run tests
go test ./...
# Test with coverage
go test -cover ./...├── internal/ # Business modules (auth, gym, user, exercises, etc.)
├── api/ # API setup and routing
├── cmd/ # Application entry points and utilities
├── frontend/ # Static web files (HTML, CSS, JS)
├── docs/ # 📚 Comprehensive documentation
├── pkg/ # Shared utilities and middleware
└── config/ # Configuration management
┌─────────────────────────────────────────┐
│ AthenAI Platform │
├─────────────────────────────────────────┤
│ Platform Layer (public schema) │
│ • System Administration │
│ • Global Exercise Library │
│ • Shared Templates & Equipment │
├─────────────────────────────────────────┤
│ Tenant Layer ({gym_uuid} schemas) │
│ • Gym-specific Users & Data │
│ • Custom Exercises & Equipment │
│ • Workout Instances & Tracking │
└─────────────────────────────────────────┘
Key Features:
- 🔐 Schema-level tenant isolation for complete data security
- 🎯 Role-based access control (Platform Admin, Gym Admin, Trainer, Member)
- 🔄 Modular architecture following consistent Go patterns
- 📊 PostgreSQL multi-tenancy with shared and isolated data
Complete documentation available in /docs
| Topic | Description |
|---|---|
| 📚 Documentation Hub | Complete guide and navigation |
| 🏗️ Backend Architecture | Modules, patterns, and system design |
| 🗄️ Database Design | Schema, relationships, and multi-tenancy |
| 🔐 Security Model | Authentication, authorization, and tenant isolation |
| ⚙️ Module Pattern | Standard patterns for creating new modules |
| 🔧 Configuration | Environment setup and deployment |
| 📡 API Reference | Complete OpenAPI specification |
# Run all tests
go test ./...
# Specific module tests
go test ./internal/auth/...
go test ./internal/gym/...
# Integration tests
go test ./tests/...
# Coverage report
go test -cover ./...- Follow the Module Pattern: Use the standard structure in
docs/module-pattern.md - Security First: Review
docs/security-model.mdfor security guidelines - Update Documentation: Keep docs in sync with code changes
- Test Coverage: Include tests for new modules and features
This project is licensed under the MIT License - see the LICENSE file for details.
🚀 Ready to start? Check out the complete documentation for detailed guides and architecture information.