First of all, you have to download the following software:
The database is a MySQL database, which runs on a docker-container.
NodeJS is used for the backend.
Angular is used for the frontend.
Navigate with the terminal to the directory your choice and type: git clone https://github.com/ukalto/RandomMath.git
to clone the directory. Now open the project with an editor your choice. I recommend VSCode.
npm install
will install the node_modules
docker-compose up
will start the docker-compose file
npm install -g @angular/cli
will install Angular CLI globally
- Navigate to the
RandomMath_Frontend/
direcotry and executenpm install
. - Navigate to the
RandomMath_Backend/
direcotry and executenpm install
. Based on the package.json file, npm will download all required node_modules to run a Angular application. - Navigate to the
RandomMath/data/db/
directory and executedocker-compose up
. - Navigate to the
RandomMath_Frontend/
directory and executenpm install -g @angular/cli
to install the Angular CLI globally.
Navigate to the RandomMath/
directory and create a package called data. In the package data create a package db.
create table users (
userid integer primary key AUTO_INCREMENT,
username varchar(45),
password varchar(128),
email varchar(60),
score integer,
playedGames integer,
scorePercentage decimal(5,2)
)
The password is hashed with SHA-512 at the moment a user signs up. If somebody logs in to the website, the hash of the passwords will be compared. Furthermore, the session is handled with a bearer token. User data will only be sent at login or sign up.
- data/db
- node_modules in frontend and backend package
npm start
will start the application.
- Navigate to the
RandomMath/data/db/
directory and executedocker-compose up
, to start the container. - Navigate to the
RandomMath_Frontend/
direcotry and executenpm start
to start the application. - Navigate to the
RandomMath_Backend/
direcotry and executenpm start
to start the application.
Now start a browser your choice and open the url http://localhost:4200/ (The standard port from Angular).
You find further information to Angular in my second Readme
If you wanna know more about the software and it's functions then read it at the game-description tab on my website.