- Mihaela Florea ([email protected])
- Leonid Goldberg ([email protected])
- Boyang Wang ([email protected])
- Jianyu Sun ([email protected])
If you paste the db_model.dbml file into this page, it will allow you to visually view and edit the ERD diagram. But don't sign up on the website or save the file on the website because that would make it public. I think we can later fix that if we need to.
The good thing about writing the database model in a dbml file is that if we choose to use a relational database such as Postgres, we can convert the dbml into an sql script that will automatically create all of the tables based on our model.
- Backend root:
- Remote (Azure): https://findaservicebackend.azurewebsites.net/
- Local: https://localhost:5000/
- PostgreSQL connection string:
- Remote: postgres://wactuseu:[email protected]/wactuseu
- Local: postgresql://admin:admin@localhost:5432/find_a_service
- Install Postgress
- Install DataGrip or similar editor (optional because you can use the command line but it helps)
- Create a local db with the following credentials
- user=admin
- password=admin
- host=localhost
- port=5432
- databse_name=find_a_service This is for testing (the frontend will be connected to the remote database on Azure)
- In the local db run the code in src/dbConfig/init.sql
- Connect to remote database (Add -> Data Source -> PostgreSQL -> Enter URL)
- Whenever you make any changes to the remote database, update the init.sql file so everyone is on the same page
- Install Node.js
- After you git clone the repository from the root folder run
npm init- The node_modules folder should appear in the root folder
- To start the backend server locally (for testing, the app will be connected to the remote one on Azure) run:
npm run start:dev5.The server should automatically restart whenever you make changes to a file 6. Check the server started by going to http://localhost:5000/ 7. You can use Postman to test functionality using the local route
.
├── src # Source files
│ ├── config # Any configuration code (e.g. to connect to postgres)
│ ├── helpers # Any constants or repetitive code
│ ├── routes # Declares all the routes
│ ├── app.js # Entrypoint of the server
│ └── middleware.js # Error handler and authentication handler
├── .env # Declares environmental variables
├── .gitignore # Declares which files not to push to github
├── package.json # Declares Node.js scripts and libraries used
└── README.md
- GET /provider/currentProvider
- POST /provider/login
- POST /provider/register
- PUT /provider/editProfile
- POST /provider/editProfile/upload
- GET /provider/unapproved
- GET /provider/:providerId
- PUT /provider/:providerId/approve
- PUT /provider/:providerId/reject
- PUT /profileUpdate/:updateId/changeStatus
- GET /profileUpdate/:providerId
- POST /profileUpdate/:providerId
- POST /customer/register
- POST /customer/login
- POST /customer/googleLogin
- GET /customer/verify/:customerId/:token
- GET /customer/currentCustomer
- GET /notification
- POST /notification/read
- GET /notification/unreadCount
- POST /admin/login
- POST /review/create
- GET /review/reviews
- DELETE /review/:reviewId
- GET /service/:serviceId
- POST /service/:serviceId/upload
- GET /service/services
- POST /service/create
- POST /service/update
- DELETE /service/delete
- GET /serviceRequest
- POST /serviceRequest/:serviceId
- GET /serviceRequest/:serviceRequestId
- PUT /serviceRequest/:serviceRequestId
- PUT /serviceRequest/:serviceRequestId/status
- PUT /serviceRequest/update/:updateId/changeStatus
- GET /serviceRequest/update/:serviceRequestId
- POST /serviceRequest/update/:serviceRequestId