Fantasy Critic is like fantasy football...but for video games! You and several friends will create your own virtual video game "Publishers", and then you will assemble a roster of the games you believe will review the best. Similar to fantasy football, the players will alternate picking games in a snake draft style to start the year. At the end of the year, the winner is the team with the best lineup of video games based on scores from opencritic.com.
You can see the site at fantasycritic.games
ClientApp is the root directory for the front-end UI. In it contains a Vue.js client application. See the official Vue.js documentation for more information. The project is configured to start its own instance of the client app in the background when the ASP.NET Core app starts in development mode. The client app can also be run via webpack dev server, instead of the ASP.NET core app. Note, when using the webpack dev server, the client app will point to the official website, instead of the local ASP.NET core app.
> npm run clientYou'll need to install a few things:
- .NET 10
- Docker Desktop
- A C# IDE (Visual Studio 2022+ or JetBrains Rider)
From the repo root, bring up MySQL and run all database migrations in one step:
docker compose -f infrastructure/docker-compose-mysql.yaml upThis will:
- Start a MySQL 8.4 instance on port 3307 (to avoid conflicting with a local MySQL installation).
- Create the
fantasycriticdatabase and the required users automatically. - Run FantasyCritic.DatabaseUpdater (DbUp), which applies all schema migrations under
src/FantasyCritic.DatabaseUpdater/Scripts/. - Run FantasyCritic.LocalDatabaseTool, which seeds your local database with the latest game data (announcements, release dates, scores, etc.) pulled from the live Fantasy Critic site.
The last two services exit on their own when done. You can re-run the compose command at any time to pick up new migrations or refresh game data; it is safe to run repeatedly.
The appsettings.json for FantasyCritic.Web is already pre-configured to connect to the Docker MySQL instance, so no additional configuration is required for a basic setup. Open the solution in your IDE and run FantasyCritic.Web, or use the CLI:
dotnet run --project src/FantasyCritic.Web/FantasyCritic.Web.csprojThe site will be available at https://localhost:44477 by default.
The integration tests (FantasyCritic.IntegrationTests) drive the app through a generated typed HTTP client. That client must be regenerated any time the API changes. The generation requires the Web project to have been built first.
First time (or after a dotnet tool restore is needed):
dotnet tool restoreRegenerate the API client, then run the tests:
On Windows (PowerShell):
dotnet build src/FantasyCritic.Web/FantasyCritic.Web.csproj
scripts/Regenerate-ApiClient.ps1
dotnet test src/FantasyCritic.IntegrationTests/FantasyCritic.IntegrationTests.csprojOn Linux/macOS:
dotnet build src/FantasyCritic.Web/FantasyCritic.Web.csproj
scripts/regenerate-api-client.sh
dotnet test src/FantasyCritic.IntegrationTests/FantasyCritic.IntegrationTests.csprojThe integration tests spin up the full ASP.NET Core stack in-process and talk to the Docker MySQL database, so the database must be running (step 1) before running the tests.
- If you need social login (Google, Discord, Twitch, etc.) you will need to configure the relevant OAuth credentials via User Secrets. For day-to-day backend development these are optional.
- Database migrations are managed by FantasyCritic.DatabaseUpdater (DbUp). New migration scripts go under
src/FantasyCritic.DatabaseUpdater/Scripts/Sequential/following the existing date-based naming convention. Do not hand-edit the database directly. - I use full Visual Studio for server-side development, but Visual Studio Code works better when working on the client-side (Vue.js) code.