- Cloudflare Pages account
- Any static hosting provider should work (including just putting the
distfolder in front of a web server like nginx), but we use Cloudflare Pages and it works well.
- Any static hosting provider should work (including just putting the
- Docker / Container environment
- We use Docker Compose, however anything that can run a container should work.
- PostgreSQL database
- We also use Docker for PostgreSQL, however any existing PostgreSQL database should also work.
- Setup the frontend
- Create a new Cloudflare Pages project here
- Connect using GitHub (use the Git url
https://github.com/OliverW10/group-allocator.git) - Set the root directory to
frontend - Set the output directory to
dist - Set the environment variable
VITE_BACKEND_URLto the URL of your backend API (e.g.https://api.example.com) - Magic
- Deploy the database (keep the connection string handy)
- It is up to you how you want to deploy this. If you don't want to do this separately and would rather use Docker, simply uncomment the
dbservice in thedocker-compose.yamlfile.
- It is up to you how you want to deploy this. If you don't want to do this separately and would rather use Docker, simply uncomment the
- Create your appsettings.json file
- Place the file somewhere that can be mounted by the container
- Ensure you swap out the connection string with your one
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"MainDb": "Server=db;Port=5432;Database=GroupAllocator;User Id=user;Password=password1234"
},
"AdminEmails": [
"[email protected]",
"[email protected]"
]
}- Deploy the
docker-compose.yamlfile- If you're not using Docker, just generally follow the structure of the file for your own deployment.
- Ensure you mount the correct appsettings.json file to the container, and uncomment the
dblines if required.
- Install Docker Desktop (https://www.docker.com/products/docker-desktop/)
- Run
docker compose up --build --force-recreate(Ctrl+C to stop)
- Install Node.js (https://volta.sh/)
- Install PNPM (
npm i -g pnpm) - Install dependencies (
pnpm i) - Run
pnpm dev
- Install docker & docker-compose
- Run
docker-compose -f database.yml up -d
erDiagram
Client {
int Id PK
string Name
int MinProjects
int MaxProjects
}
File {
int Id PK
int UserId FK
byte[] Blob
string Name
}
Preference {
int Id PK
int StudentId FK
int ProjectId FK
double Strength
}
Project {
int Id PK
int ClientId FK
string Name
bool RequiresNda
int MinStudents
int MaxStudents
}
SolveRun {
int Id PK
DateTime Timestamp
double Evaluation
}
StudentAssignment {
int Id PK
int StudentId FK
int ProjectId FK
int SolveRunId FK
}
Student {
int Id PK
int UserId FK
bool WillSignContract
}
User {
int Id PK
bool IsAdmin
string Name
string Email
bool IsVerified
}
Project }o--|| Client : has_many
Preference }o--|| Student : has_many
Preference }o--|| Project : has_many
StudentAssignment }o--|| Student : has_many
StudentAssignment }o--|| Project : has_many
StudentAssignment }|--|| SolveRun : references
Student |o--|| User : has_one
User ||--o{ File : has_many
- Install Visual Studio with ASP.NET workload and .NET 9.0 component
- In the Group-allocator/backend/group-allocator directory, run the following commands:
dotnet tool restoredotnet run
- Run
dotnet user-secrets initthendotnet user-secrets set "Stripe:SecretKey" "{key}"
- Install .NET 9 SDK
- In
backend/GroupAllocator.Backendrundotnet run - Run
dotnet user-secrets initthendotnet user-secrets set "Stripe:SecretKey" "{key}"