The Web Online Game is an exercise project to learn programming with the JavaScript stack and related technologies. In this project, the user can play a game (Guess Number Game) and earn points after registering and entering the site.
- Docker
- PostgreSql image
- install docker
- run docker desktop
- clone the repo
git clone https://github.com/sajjadghorbani80/WebOnline-Game.git
- Go to Client folder
cd client
- Install requirements
npm i
- Compile TS files to JS
npx tsc
- Go to Server floder
cd ../server
- Install requirements
npm i
- Compile TS files to JS
npx tsc
- In the root folder of project you can find a config file named .env.
- Configure file to your needs or just use the default settings.
- In the server folder, you can find .env file that contains the PostgreSql connection string. Change its value according to your configuration.
- Also in client > src > assets > js path you can find config.js file that contains API_URL and Token_Header_Key, If you have changed .env file, you must change config.js file accordingly.
- To start the application just use the command below:
docker compose up -d
- Intialize DataBase
15.1. Create DataBase
npx prisma db push
15.2. Add sample Data
sudo npx ts-node --esm prisma/seed.ts
- After successful building go to http://localhost:8080 (with default settings).