Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Challenger

SQL Server Docker C# GraphQL ASP.NET Core TypeScript React PWA Redux WebSockets


Challenger is a comprehensive web application designed to manage game tournaments and user profiles. It features a robust Team vs. Team bracket system for organized competitive play.

Challenger Demo

Features

  • Tournament Management: Create and organize tournaments with customizable categories.
  • Team vs. Team Brackets: specialized support for team-based competitive brackets.
  • User Profiles: Manage user accounts and statistics.
  • Real-time Updates: Live scoring and updates powered by WebSockets.
  • Interactive Interface: A responsive React-based frontend with PWA support.

Technology Stack

  • Frontend: React, Redux, TypeScript, Progressive Web App (PWA).
  • Backend: ASP.NET Core, C#.
  • Database: SQL Server, Entity Framework Core.
  • API: GraphQL (Queries & Mutations), REST (Controllers), WebSockets.
  • Containerization: Docker support for consistency across environments.

Getting Started

Quick Start

To run the application using the provided script:

./run.sh

Manual Setup with Docker

If you prefer to run the services manually using Docker, follow these steps:

  1. Pull and Run SQL Server:

    docker pull mcr.microsoft.com/mssql/server
    docker run -d --name challenger-db -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password123' -p 1433:1433 mcr.microsoft.com/mssql/server:latest
  2. Configure App Settings: Retrieve the container IP and update appsettings.json:

    SERVER_URL_OR_NAME=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' challenger-db)
    sed -i'.original' -e "s/SERVER_URL_OR_NAME/$SERVER_URL_OR_NAME/g" ./Models/appsettings.json
  3. Build and Run the Service:

    docker build -t challenger-service .
    docker run -d -it -p 8000:80 -p 8001:443 \
      -e ASPNETCORE_URLS="https://+;http://+" \
      -e ASPNETCORE_HTTPS_PORT=8001 \
      -e ASPNETCORE_Kestrel__Certificates__Default__Password="password" \
      -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx \
      -v ${HOME}/.aspnet/https:/https/ \
      --name challenger-service challenger-service
  4. Cleanup: Restore the original configuration file:

    mv Models/appsettings.json.original Models/appsettings.json

Database Migrations

Manage your database schema with the following commands:

# Drop the existing database
dotnet ef database drop

# Remove the last migration
dotnet ef migrations remove

# Add a new migration (e.g., InitialCreate)
dotnet ef migrations add InitialCreate

# Apply migrations to the database
dotnet ef database update

Project Structure

A high-level overview of the project's organization:

  • API/: The main ASP.NET Core web application.
    • ClientApp/: The React frontend application.
    • Controllers/: API controllers.
  • Models/: Domain entities and database models.
  • Repository/: Data access logic and repository implementations.
  • Schema/: GraphQL schema definitions, including Types, Queries, and Mutations.
  • Hub/: WebSocket connection handling logic.

Architecture

The application follows a modern, layered architecture designed for scalability and maintainability.

  • Client Layer: A Single Page Application (SPA) built with React and TypeScript. It utilizes Redux for state management and communicates with the backend via GraphQL and WebSockets.
  • Service Layer: An ASP.NET Core Web API that serves the frontend and handles business logic. It exposes a GraphQL API for flexible data retrieval.
  • Data Access Layer: Implements the Repository pattern using Entity Framework Core to abstract database interactions.
  • Database: SQL Server acts as the persistent storage.

Class Diagram

The core business logic and domain relationships are modeled in C#.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Challenger is a web application that support all kind of games with user management.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages