@@ -31,23 +31,24 @@ When using IntelliJ, use `import project` on the backend folder. Use import from
Start the backend by running `bootRun` in `TamApplication`.
## Database
This platform uses the username (_tam_manager_), password (_tam_password_) and database name (_tam_database_) found in ```./backend/application.properties```, where these can changed as well. __Production uses__ `./backend/application-prod.properties`.
This platform uses the username (_tam_manager_), password (_tam_password_) and database name (_tam_database_) found in ```./application.properties```, where these can changed as well. __Production uses__ `./application-prod.properties`.
To create the database, log into MySQL and use the command
To create the database, and a user tam_manager, log into MySQL and use the command
After this, quit the MySQL command line by entering ```\q```. In order to import the tables into tam_database, using user _user_name_, run
After this, quit the MySQL command line by entering ```\q```. In order to import the tables into tam_database, using user _tam_manager_, run (from the root folder of the project)
```
mysql -u user_name -p tam_database < ./backend/src/main/resources/sql/createtables.sql
mysql -u tam_manager -p tam_database < ./src/main/resources/sql/createtables.sql
```
In order to give necessary permissions to the platform, log in to the MySQL root and execute the following commands:
To remove the database and tam_manager user, log into a different (privileged) account (e.g. _root_) and run the following:
On the server, use ```./gradlew build``` in the root of the project to build the jar, which will also build the frontend. Run the jar with ```java -Dspring.profiles.active=prod -jar build/libs/tam-0.0.1-SNAPSHOT.jar --server.port=8000```