https://github.com/thang2162/pumpjack
A PERN (Postgres, Express, React.JS and Node.JS) App for the Pumpjack coding challenge.
https://github.com/thang2162/pumpjack
express node pern postgres react
Last synced: 2 months ago
JSON representation
A PERN (Postgres, Express, React.JS and Node.JS) App for the Pumpjack coding challenge.
- Host: GitHub
- URL: https://github.com/thang2162/pumpjack
- Owner: thang2162
- License: unlicense
- Created: 2019-11-18T05:39:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:06:07.000Z (over 2 years ago)
- Last Synced: 2025-01-14T02:12:10.705Z (4 months ago)
- Topics: express, node, pern, postgres, react
- Language: JavaScript
- Size: 3.52 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
1. Clone Repo
2. Install Postgres (Skip if Installed)
3. Start Postgres (Skip if Started)
4. Run Command from Shell 'createdb pumpjack_db' to create DB## Server Instructions
1. cd into pumpjack
2. Run 'npm install' or 'yarn install' to install dependencies
3. Run Command from Shell 'node db createUserTable' to create User Table
4. Run Command from Shell 'node db createProductTable' to create Product Table
5. Run Command from Shell 'node db seedUserTable' to seed User Table
6. Run Command from Shell 'node db seedProductTable' to seed Product Table
7. Run Command from Shell 'node server.js' to start server## App Instructions
1. cd into pumpjack-spa
2. Run 'npm install' or 'yarn install' to install dependencies
3. Run 'npm start' or 'yarn start' to start app.## Server Authentication
For restricted endpoints you'll need to request an authorization token (jwt) via
a POST request to 'localhost:8080/public/auth' with a JSON object containing an email
and password for example:{"email": "[email protected]", "password": "some_password"}
When Calling a restricted endpoint you must attach an 'Authorization' header to
the request with the authorization token (jwt) from the '/public/auth' endpoint.## User Email / Passwords
[email protected] / 123456[email protected] / abcdef
[email protected] / abc123
[email protected] / 121212
[email protected] / ababab
## Image uploads
You can add an image to a product by sending a PUT request to the '/private/addImage/#'
where # is the id of the product you are adding the image to.Please make sure to assign the file object containing the image to the
'image' key as 'multipart/form-data'.## .env file
Please make sure to update the environment variables before starting the server.