Playtesters.API is a lightweight, secure RESTful service built with .NET 8 and Entity Framework Core (SQLite).
It’s designed for indie developers or small teams who need a simple way to manage playtesters, access keys, and access validation history for private or early-access game builds.
This project was created to support the roguelike action game I'm building with my best friend from school.
- Create and manage tester accounts with unique access keys (GUIDs).
- Track successful access validations with timestamp and IP address.
- Filter and inspect tester access history by country for better monitoring and detection of shared access keys.
- Built-in IP geolocation system powered by ip-api.com, with caching to minimize API calls and improve performance.
- Secure admin endpoints using an API key stored in
.env. - Public endpoint for game clients to validate access keys.
- Easy to integrate with Unity or any custom launcher/client.
- Organized structure using use cases, services, DTOs, validators, and minimal APIs.
- .NET 8 (Web API)
- Entity Framework Core (SQLite)
- Swashbuckle (Swagger)
- FluentValidation
- SimpleResults
- DotEnv.Core
- NUnit
- FluentAssertions V7
- Install .NET 8 SDK.
- Navigate to the project directory:
cd src- Create a
.envfile:
API_KEY=your-admin-key
SQLITE_DATA_SOURCE=playtesters.db- Run the API:
dotnet run- Access the application with this URL:
http://localhost:5183/swagger
- Build the Docker image from the root of the repo:
docker build -t playtesters-api .- Run the container without persistence (only for testing):
docker run -p 5183:8080 --env-file .env playtesters-apiIf you want the playtesters.db file to persist across restarts:
- Run the container with a mounted volume:
docker run \
-p 5183:8080 \
--env-file .env \
-v playtesters_data:/app/data \
playtesters-api- Make sure your connection string points to:
SQLITE_DATA_SOURCE=/app/data/playtesters.dbWhen the application starts, EF Core automatically applies the migrations and creates the SQLite database (along with its schema) inside the path /app/data.
This is important because the database file is generated at runtime, meaning the container writes it into the mounted volume.
By doing this, the volume does not overwrite the database path with an empty directory — instead, it simply persists the file that the app creates.
All admin endpoints require the following header:
X-Api-Key: <your-admin-key>The admin key must be defined in your .env file:
API_KEY=your-admin-keyOnly the endpoint /api/testers/validate-access is publicly accessible by game clients.
The public /api/testers/validate-access endpoint can be called directly from your Unity project to validate tester access before allowing gameplay or enabling private build features.
Below is a quick demonstration of how you can integrate the Playtesters API into a Unity login screen using a simple access key workflow.
You can use this Playtesters.API.http file (VS Code / Rider / Visual Studio compatible) to test every endpoint of the API.
MIT License — feel free to use, modify, and extend it for your own projects.
