System Requirements
For Local Development
- .NET 8.0 SDK or higher
- SQLite (included with .NET)
- Visual Studio Code or Visual Studio 2022 (recommended)
- Git for version control
For Docker Deployment
- Docker 20.10 or higher
- Docker Compose 1.29 or higher
- Minimum 2GB RAM available
- Minimum 1GB disk space
Installation Methods
Docker Installation
Recommended for quick setup and production deployment
Local Development
Best for development and debugging
Docker Installation
Docker provides the simplest way to run the application with all dependencies included.Install Docker
Download and install Docker Desktop for your operating system:Verify installation:
Review Docker Configuration
The
docker-compose.yml file configures the application:docker-compose.yml
The application runs on port 80 inside the container and is mapped to port 5000 on your host machine.
Build and Start
- Build the application using the multi-stage Dockerfile
- Install .NET EF Core tools
- Create the SQLite database at
/app/Torneo.db - Run database migrations for both main and identity contexts
- Publish the application
- Start the container in detached mode
Docker Build Process
TheDockerfile uses a multi-stage build for optimization:
Dockerfile
Local Development Installation
For development, debugging, and contributing to the project:Install .NET SDK
Download and install .NET 8.0 SDK:Verify installation:Expected output:
8.0.x or higherRestore Dependencies
Navigate to the solution directory and restore NuGet packages:This installs all required dependencies including:
- ASP.NET Core Identity
- Entity Framework Core
- SQLite provider
- Health checks
- Data protection libraries
Configure Database
Set the database connection string:
The database file will be created automatically in the current directory when you first run migrations.
Run Database Migrations
Apply migrations to create the database schema:
If
dotnet ef is not found, install it globally:Project Structure
The application follows a modular architecture:Key Dependencies
The application uses the following NuGet packages:Frontend Project
Torneo.App.Frontend.csproj
Identity Configuration
The application includes ASP.NET Core Identity with the following settings:Program.cs
Configuration Options
Environment Variables
Configure the application using environment variables:| Variable | Description | Default | Required |
|---|---|---|---|
DATABASE_CONNECTION_STRING | SQLite database path | Data Source=/app/Torneo.db | Yes |
ASPNETCORE_ENVIRONMENT | Environment name | Production | No |
PORT | Application port | 80 | No |
Application Settings
Editappsettings.json for additional configuration:
appsettings.json
Development Settings
For development-specific configuration, editappsettings.Development.json:
appsettings.Development.json
Database Configuration
The application uses SQLite with Entity Framework Core:DataContext.cs
Database Entities
The database includes the following tables:- Municipios: Municipalities where teams are located
- DirectoresTecnicos: Technical directors (coaches)
- Equipos: Tournament teams
- Jugadores: Players registered to teams
- Partidos: Matches between teams
- Posiciones: Tournament standings
Health Checks
The application includes health check endpoints:Program.cs
IDE Configuration
Visual Studio Code
Recommended extensions:- C# Dev Kit by Microsoft
- C# by Microsoft
- .NET Core Test Explorer
- Docker by Microsoft
.vscode/launch.json):
Visual Studio 2022
- Open
Torneo.App.sln - Set
Torneo.App.Frontendas startup project - Press F5 to run with debugging
Production Deployment
Docker Production Build
For production deployment with Docker:Manual Deployment
For manual deployment to a server:Troubleshooting
Common Issues
Port 5000 already in use
Port 5000 already in use
Change the port in
docker-compose.yml or use --urls flag:Database migration failed
Database migration failed
Ensure:
dotnet-eftools are installedDATABASE_CONNECTION_STRINGis set correctly- Directory has write permissions
NuGet package restore failed
NuGet package restore failed
Clear NuGet cache and restore:
Docker build fails
Docker build fails
Clear Docker cache and rebuild:
Logs and Debugging
View application logs:appsettings.json:
Next Steps
After installation:Quickstart Guide
Create your first team and explore features
Configuration
Customize application settings
API Reference
Learn about repository interfaces
GitHub
View source code and contribute