Spring+MySQL backend
- install mysql;
- [FOR NOW] use script in CS506_Cash-Splitting/sql/db_init.sql to initialize user, db, and tables: SOURCE .../sql/db_init.sql;
PS: password is changed to '12345678' for 'root'@'localhost'; userdb and hivedb are created with 2 dummy entries for testing; [see CS506-spike-exercise/sql/db_init.sql for details]
- Link database to this project: modify CS506_Cash-Splitting/src/main/resources/application.properties [if needed]
- Link database to intellij: intellij->View->Tool Window->Database: click "+" to add MySQL database (e.g.:database=localhost:3306/cash_splittingtester)
PS: default_port=3306, db_name_initialized_with_db_init.sql=cash_splittingTester
- Download mysql server for windows at: https://dev.mysql.com/downloads/installer/
- In "Select Product and Feature": select and install MySQL Servers->MySQL Server->MySQL Server 8.0->MySQL Server 8.0.20 (or whatever, they all work)
- Add database with user=root, password=12345678 (or whatever, but change setting in application.properties if use other password)
- Link database to this project: modify CS506_Cash-Splitting/src/main/resources/application.properties [if needed]
- Link database to intellij: intellij->View->Tool Window->Database: click "+" to add MySQL database (e.g.:database=localhost:3306/cash_splittingtester)
- run CS506_Cash-Splitting/sql/db_init.sql from intellij on selected the database just added (e.g. localhost:3306...)
PS: default_port=3306, db_name_initialized_with_db_init.sql=cash_splittingTester
In intellij, navigate to CS506_Cash-Splitting/src/main/java/com.cs506.cash_splitting/service/CashApplication, hit run (shift + F10); If no error message in console, application is running; Access backend by opening 'localhost:<port_number>/api/hive' or 'localhost:<port_number>/api/user' in a browser
PS: default port_number is 8181; if occupied, change port_number in application.properties by adding: server.port=<your_port_number>
Run backend; In terminal, navigate to Cash-Splitting-frontend/,
run: npm install && npm start (it will start in a browser and link with backend automatically if configured properly)