Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
**HOW TO RUN:**
- Download node.js if you don't already have it
- Clone the repository
- cd to project directory
- In the terminal run these commands:
npm init -y
npm install express pg dotenv express-session body-parser connect-pg-simple cors bcryptjs jsonwebtoken nodemon
npm start
NOTE:
don't forget to add "start" script to package.json file
ex:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
**HOW IT WORKS**
`app.js`
- sets up the server as an express() app, defines cors middleware, listens for connections
`db.js`
- connects to the database, and exports the connection pool object for the rest of the app to use
`package.json`
- defines the scripts to run the app, and the dependencies for the app to run
`schema.sql`
- defines the database schema, and the tables and columns that will be used in the app
...
NEED TO UPDATE THIS WITH FINAL FILE STRUCTURE
**Development notes/goals:**
determine any extra features to make ready for production
create AddClient controllers in isacController to add clients - also in FE
- only for 'admin' users
- NEED TO TEST THIS
create setMetalPrices Interface
Create query to look at time in between recent receipts to suggest an average pickup time
create cron tasks on render to update needsPickup
need to add logic to determine when clients need pickups based on their last pickupdate and time in between
- this has been done but needs to be tested, and it might be split off as a seperate project due to the fact that render allows cron projects as a service
connect last pickup client attribute to lastest receipt date -> unless manually changed (update pickupdate)
- add manual update pickup option in clientInfo and route pages
NOTES:
- sum(receipts weights and payout) = totals on clientInfo (ClientTotal and receiptTotal tables): this will come into effect when the server is set up with the receipt generating react client and is receiving receipt data over the network
- cron task needs to check for overdue pickups based on users who have a value for the avgerage time between pickup attribute
OPTIONAL/EXTRA:
consider adding queries to allow for more interesting displays/searches in the ISAC front end
- search for clients by however has the highest amount of any searched metal
- have a ranking page of highest volume totals for different metals and maybe the top 10 highest volume clients overall
- any other interesting comparisons based on the `schema.sql` file