https://github.com/ibraabukaff/backend_frontend_test
https://github.com/ibraabukaff/backend_frontend_test
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ibraabukaff/backend_frontend_test
- Owner: ibraAbuKaff
- Created: 2019-11-06T20:44:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T13:00:56.000Z (over 2 years ago)
- Last Synced: 2024-12-30T10:47:33.681Z (5 months ago)
- Language: JavaScript
- Size: 1.83 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
###Backend:
How to make it up and running:
1- `cd backend`2- create .env in the backend directory
3- copy the following to it:
```dotenv
MONGODB_URL=mongodb://mongo_service:27017/tenderd
JWT_KEY=WinterIsComingGOT2019
REQUEST_EXPIRATION_IN_MINIUTES=4```
4-
``
docker-compose up --build
``Db schema:
I used MongoDb, with 3 collections:1- contractor_requests
2- supplier_bidding
3-users (has both contractor and supplier)
https://imgur.com/uY9bqiP
https://imgur.com/x4GYGCt
https://imgur.com/GfAQB57
I used mongoose as an ODM in the ndoe js backend
###Requests:
Please refer to the postman json collection: https://api.myjson.com/bins/19eatgThe Api Journey:
1- register/login to get a token (it can be contractror token or supplier token)
2- send this token in the contractor/supplier requests in the headers to authorize them
3- logout the user
===============
#####for processing the expired requests i used cronjob (file: backend/cronjob.js) which is running every second to check on the requests...
if the request got expired , i search for the lowest price for that request in the collection `supplier_bidding`, once i find it i attach that document to that
request in `contractor_requests`===============
###Frontend
How to make it up and running:
``
cd frontend
npm install
yarn start or npm start
``What i achieved:
Login/register is done (backend part also doen)
The Contractor part is done (backend part also done)
Supplier Part (still not done) (but the backend part for it is done...)
I used Redux and redux thunk for the state management...