Welcome to Krokelo!
Krokelo is a web application created to track Crocinole games at SpareBank 1 Utvikling. You can submit duel games (1 vs 1) and team games (2 vs 2), and the application will calculate Elo ratings for players and teams. Leaderboard and profile pages shows the current stats.
The application is implemented in Remix with a Postgres database.
docker run --name postgres16 -e POSTGRES_DB=krokelo -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=666 -p 5432:5432 -d postgres:16
DATABASE_URL="postgresql://postgres:666@localhost:5432/krokelo"
COOKIE_SECRET="s3cr3ts3cr3t"
npm install # Install dependencies
npm run setup:db # Setup Prisma and migrate database
npm run dev # Start app in dev mode with hot reload
There is a backup of the production data included in this project in the db_backups folder. You can use this to get a more realistic dev env. You can restore the backup data to your local db instance in pgadmin4 or via terminal:
docker cp db_backups/03oct2024.dump {container_id}:/03oct2024.dump
docker exec -i postgres16 pg_restore --clean --no-owner --no-privileges -U postgres -d krokelo 03oct2024.dump
First, build your app for production:
npm run build
Then run the app in production mode:
npm start
# Backup database
pg_dump -Fc "postgresql://username:password@host:port/dbname" > db.dump
# Restore database (same owner and roles)
pg_restore --verbose -d dbname db.dump -h host -p port -U username
# Restore database (new owners and roles)
pg_restore --verbose --no-owner --role=username -d dbname db.dump -h host -p port -U username