Now, you have the repo with all the dependency. After that, you'll have to create the database that is used for the account creation and usage.
Now, you have the repo with all the dependency. After that, you'll have to create the database that is used for the account creation and usage.
```
```
mysql -u user -p
chmod +x ./tools/db_docker_init.sh
> mysql source db_script.sql
./tools/db_docker_init.sh
```
```
I choose to use container for mysql to avoid bugs that can happened when working on other computers that my main one. It could also fix bug you could face so it's better overall.
Finally, you need a `.env`file with your personnal mysql information so follow those steps. You also need this file to specify your cookie's private key so you can create them
Finally, you need a `.env`file with your personnal mysql information so follow those steps. You also need this file to specify your cookie's private key so you can create them
```
```
@ -43,13 +45,18 @@ touch .env
The .env file should look like that
The .env file should look like that
```
```
DB_USER=userName
ACTUAL_ENV=dev
DB_PASSWORD=UserPassword
DB_USER=root
DB_NAME=maettleship
DB_PASSWORD=password
DB_NAME=battleship
DB_HOST=localhost
DB_HOST=localhost
COOKIE_SECRET_KEY=secret_key
COOKIE_SECRET_KEY=secret_key
```
```
You can use the env file as it is in my example but if you want make it yours just don't forget to have the same variable in your env file that in you mysql config.
The `ACTUAL_ENV` variable aim to make the switch between dev and prod environment easier. You won't have to change it if you want to run maettleship localy.
Now you can start the server using the following command on your terminal.
Now you can start the server using the following command on your terminal.
`npm run dev`
`npm run dev`
@ -94,4 +101,4 @@ Here is a cool list of the different docs I used on this project