Skip to content

rickylabs/table-football-challenge

Repository files navigation

README

README

Table Football Challenge

This monorepo is build with following stack:

  • DB: Postgres
  • Caching: Redis
  • Baas: Directus
  • ORM: Drizzle
  • API: Rest + Graphql
  • Frontend: NextJS

How to Run This Project

Prerequisites

  • Docker & Docker Engine latest version
  • pnpm latest version

Steps

Clone the repository from GitHub.
git clone https://github.com/rickylabs/table-football-challenge.git
Copy .env.example to .env.local and .env.production
cd apps/frontend
cp .env.example .env.local
cp .env.example .env.production

For Windows & Mac user change NEXT_PUBLIC_DIRECTUS_API value as suggested in comment below:

NEXT_PUBLIC_DIRECTUS_API=http://172.17.0.1:8055
# prefer this if you're on Windows or Mac NEXT_PUBLIC_DIRECTUS_API=http://host.docker.internal:8055
Navigate to the project directory.
cd table-football-challenge
Start the staging server.
make build-staging
# Go grab a coffee
make start-staging

Wait for your builds to complete

Open http://localhost:3000 with your browser to see the frontend app.

Open http://localhost:8055 with your browser to see the admin dashboard

Directus may take a few seconds to spin up for the first time since it depends on DB. You can monitor your services with docker dashboard to see when they are ready.

Notes

More info about the frontend setup here: Frontend README

OpenAPI and GraphQL SDL specs available here (using postman with admin token): OpenAPI GraphQL SDL

All existing users have password "Pass4directus". You can manage existing users and data from Directus admin dashboard (default pswd: "d1r3ctu5"). Or you can manage tables directly from Drizzle studio (see below to run studio in DEV mode). You can directly register new users from the frontend app.

Only players that have participated in at least one game will be shown in the leaderboard.

DEV / Contribute / Troubleshooting

To work with the dev config follow below steps

1: Start the dev server.

make start-dev

Docker frontend service will run in "watch" mode (see: https://www.docker.com/blog/announcing-docker-compose-watch-ga-release/ ) allowing you to live edit your frontend code with docker.

You can now open your favorite editor and edit NextJS project under apps/frontend

2: if you want to inspect DB you can simply run from root folder

pnpm run studio 

You can now open https://local.drizzle.studio/?port=3001

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published