This is the pre-assignment for the Solita Dev Academy Finland 2023.
In the backend folder, you will find the DBScript.sql file.
Open it and copy all of its content.
Open your SQL database in the terminal and paste the content of the file.
When it is done, you will have a database.
In the root of the frontend and backend folders, you will find .env files Open them and change the values if needed:
Field name | Description |
---|---|
DATABASE_DIALECT | mariadb |
DATABASE_NAME | name of your database, helsinki_city_bike is default |
DATABASE_USER | username of your SQL database |
DATABASE_PASSWORD | password for the username |
SERVER_HOST | hostname, localhost is default |
SERVER_PORT | port number, where you wish to run API , 8080 is default |
CORS_ORIGIN | base URL of your application = where your application (UI) is running, http://localhost:3000 is default |
REACT_APP_SERVER_HOST | hostname should be the same as SERVER_HOST, localhost is default |
REACT_APP_SERVER_PORT | port number should be the same as SERVER_PORT |
REACT_APP_SERVER_PORT | http://localhost:8080 isdefault |
Go into the frontend and backend folders one by one and write the following command in the console:
npm i
Download the following files:
https://dev.hsl.fi/citybikes/od-trips-2021/2021-05.csv
https://dev.hsl.fi/citybikes/od-trips-2021/2021-06.csv
https://dev.hsl.fi/citybikes/od-trips-2021/2021-07.csv
Put them in the following location:
backend/data/csv/journeys
Important! Delete addDatahere file.
Note: backend/data/csv/bicycle-stations-dataset has already file inside, and it accepts another files with same format if it is desired (source: https://opendata.arcgis.com/datasets/726277c507ef4914b0aec3cbcfcbfafc_0.csv)
- Go to -> backend/server.js file and uncomment the 32nd row
- Write the following command in the console:
npm run start
//todo make another separeted logic for the converter
- Wait about 3 hours for the results to be converted. On success, comment back the 32nd line and reload the application.
4.2 Import dumped database from the resource : https://drive.google.com/file/d/1-1cURsNInHa1pqPPQryHpmYQvUVE6Iy7/view?usp=share_link
npm run start
By default it will be run on the http://localhost:8080/
Then , in your usage will be different paths, that are described in the swagger http://localhost:8080/api-docs/
And here are er diagrams , for better understanding with which format the api works
To run the frontendt, go to the frontend folder and write the following command in the console: npm run start
By default it will be run on the http://localhost:3000/ port