This is our service Golden Time's backend repository which only contains content about backend logic. Please visit Android for Golden Time to get more general information about our service. Wear OS for Golden Time is also available. Or please refer our submission or introduction video to find out what we are looking for!
http://gdsc-next.com:3000 (Only during the competition!)
We strongly recommend to clone and run this locally to prevent unexpected problem during the competition.
Please refer to APISpec.md to know which request parameters are needed and how the responses look like for each endpoint.
Name | Method | URL |
---|---|---|
Make new SOS | POST | /sos |
See current SOS situation | GET | /sos/:sos_id |
Report my location | POST | /sos/:sos_id/rescuer/location |
Accept rescue request | POST | /sos/:sos_id/rescuer/accept |
Notify my arrival | POST | /sos/:sos_id/rescuer/arrived |
Notify the situation is over | POST | /sos/:sos_id/done |
See rescuers status | POST | /sos/:sos_id/rescuers |
Name | Method | URL |
---|---|---|
Get a list of diseases | GET | /disease?ids=1,2,3 (Get entire list if no ids specified) |
Get information of specific disease | GET | /disease/:disease_id |
Name | Method | URL |
---|---|---|
Get a list of cases | GET | /case |
Get information of specific case | GET | /case/:case_id |
- Node.js with express, firebase-admin, forever, morgan, mysql, nodemon
- Firebase
- MySQL
- Node.js: v18.12.1 (minimum)
- MySQL: v8.0.32 (minimum)
- Firebase Project and its Project Key
- Google Cloud Platform Project (to deploy)
- Clone the project.
git clone https://github.com/gdsc-ys/golden-time-backend.git
- Make folder
/auth
which will contain your authentication information. - Make
fbAuth.json
in/auth
to save your Firebase authentication information with following format:{ "type": "", "project_id": "", "private_key_id": "", "private_key": "", "client_email": "", "client_id": "", "auth_uri": "", "token_uri": "", "auth_provider_x509_cert_url": "", "client_x509_cert_url": "" }
- Make
sqlAuth.json
in/auth
to save you MySQL authentication information with following format:{ "host": "", "user": "", "password": "", "database": "" }
- Run MySQL command line and run
source databaseDump.sql;
to set up database and some sample datas. If you are re-setting the database, note that you should delete the previous database withdrop database `gdsc-ys-golden-time`;
. - Run
npm init
to initialize app you cloned. This will automatically install all of the required packages. - Run
npm start
to execute the server. You can make the app to run persistently with some packages you prefer. I will provide an example of deploying server withtmux
andforever
.tmux new -s deploy forever --minUpTime=1000 --spinSleepTime=1000 start -c ‘npm start’ ./