Getting started
This frontend is created using nextJs. Notice the Dockerfile at the root folder. It is a multi stage Dockerfile that build a dev and a prod version of the app.
You can of course start the frontend directly with npm run devor yarn dev
- import this
global-config.tsile is the backbone of your frontend app. You setup here all the important things like routes, stripe config, auth config etc .. It iis still and always under construciton and maintenance. It must be typesecure so create/edit the ConfigType
Dev
way 1
- First, build your docker image:
docker build --target production -t ze-frontend-dev . - Then run the container
docker run -p 3000:3000 ze-frontend-dev
way 2 (RECOMMENDED)
- Run
docker compose up --buildoutside the frontend folder, this way frontend and backend are up and when you make changes, they both automatically refresh
Production
- First, build your production docker image:
docker build --target production -t ze-frontend-prod . - Then run the container
docker run -p 3000:3000 ze-frontend-prod
Frontend Tools
- As a Component library we have schad/cn and magic UI.
Frontend Logic
The frontend is connected to the backend. There is a players hook that takes care of all logic of getting players, creating a new player and deleting a player. This is following a Best practice way of handling such cases.