First, install all dependencies using yarn or npm before moving on. I recommend npm because yarn couldn't find bcryptjs when I was setting this up.
Run npm run start OR yarn start to start. By default the server runs on port 5000 if it is not found at https://ill-serve-soup2-db.herokuapp.com/
Database Tables Inventory | Users | Locations |
CRUD Endpoints Inventory | Users | User Accounts | Locations |
NOTE: Do not include the id number in any PUT or POST requests. The system autogenerates it.
NOTE #2: You must put quotation marks around the key names in your objects, otherwise you will receive an error. { "username" : "abc123" }, not { username : "abc123" }
Column names are italicized and bolded
Used for managing total inventory and individual items. Able to Add items, remove items, update items AND get a list of the total inventory
-
Has an auto-incrementing unique id number (you don't need to add this)
-
An item name is required and must be unique, with a max length of 255 characters
-
A quantity is optional. If you don't add a quantity, it will default to 0.
-
The units are also optional. This would be useful for entering units of measure for ingredients. Can be anything and is made to be flexible for a soup kitchen that probably does not track the inventory down to the ounce. (example: "lbs" or "bags" for dry goods, "cans" for canned goods)
example:
id | name | quantity | units |
---|---|---|---|
1 | Chicken Soup | 25 | cans |
Used to manage list of users and individual users
-
Has an autoincrementing, unique id number (you don't need to add this)
-
A user username is required and must be unique, max length 255 characters
-
A user password is required, max length 255 characters.
-
A user name , max length 255 characters
-
A user role is required, max length 128 characters (Though this will depend on whoever creates the registration form, here are some examples: "admin", "cook", "assistant", "manager", "volunteer", etc. )
-
A user email , max length 255 characters
-
A user phone , max length 128 characters
example:
id | username | password | name | role | phone | |
---|---|---|---|---|---|---|
3 | jsmith99 | password | Joe Smith | volunteer | jsmith99@email.com | 123-456-7890 |
Used to manage list of locations and individual locations
-
Has an autoincrementing, unique ID number
-
A name is required and must be unique, max length 255 characters
-
A streetAddress, max length 255 characters
-
A city , max length 255 characters
-
A state, max length 128 characters
-
An email , max length 255 characters
-
A phone , max length 128 characters
example:
id | name | streetAddress | city | state | zipCode | phone | |
---|---|---|---|---|---|---|---|
3 | Downtown | 123 Main St | Townville | Oregon | 12345 | soupkitchen@email.com | 123-456-7890 |
Returns a JSON object with the entire inventory. User must be logged in to access.
The request body must include a unique name, and can optionally include quantity and units. User must be logged in to access. Returns a success message and the id number of the new item.
{
name: "Tuna - Salad Premix", //required
quantity: 89,
units: "ounces",
},
Returns a JSON object with the corresponding item. User must be logged in to access.
The request body must include information to be updated. User must be logged in to access.
Permanently removes the item from the inventory. A confirmation dialog may be a good idea here. User must be logged in to access.
Returns a JSON object with the entire users list. User must be logged in to access this.
REACT DEV >> You need to have a way to retrieve the token that is generated.
Returns a JSON object with the corresponding user. User must be logged in to access.
{
"id": 4,
"username": "joller3",
"name": "Jerrie Oller",
"role": "cook",
"email": "joller3@ebay.co.uk",
"phone": "529-300-3099"
}
The request body must include information to be updated. User must be logged in to access.
Permanently removes the corresponding user from the database. A confirmation dialog may be a good idea here. User must be logged in to access.
The request body must include a unique username and a password. It can optionally include a name, role, email, and phone number. Returns a success message and the id number of the new user.
{
username: "jdacthj", //unique, required
password: "hvTsxvWsRRl", //required
name: "Jaquenette D'Acth",
role: "volunteer",
email: "jdacthj@ihg.com",
phone: "710-804-5935",
}
The request body must include a unique username and a password matching what is on the database.
{
username: "jdacthj", // required
password: "hvTsxvWsRRl", //required
}
REACT DEV >> You need to have a way to store the token that is generated. LocalStorage(setItem) is a simple way
Returns a JSON object with the entire locations list. User must be logged in to access.
The request body must include a unique name, and can optionally include a streetAddress, a city, state, zipCode, email, and phone. User must be logged in to access.
{
name: "Independence", // unique, required
streetAddress: "20 Saint Paul Park",
city: "Bronx",
state: "New York",
zipCode: 12345,
email: bronxsoupkitchen@email.com,
phone: "718-395-9875",
},
Returns a JSON object with the corresponding location. User must be logged in to access.
{
id: 6,
name: "Northview",
streetAddress: "7172 Northridge Crossing",
city: "Plano",
state: "Texas",
zipCode: "75074",
email: "estockings5@odnoklassniki.ru",
phone: "972-650-6963",
},
The request body must include information to be updated. User must be logged in to access.
Permanently removes the corresponding location from the database. A confirmation dialog may be a good idea here. User must be logged in to access.
.-~~~~~~~~~-._ _.-~~~~~~~~~-.
__.' ~. .~ `.__
.'// END \./ OF THE \\`.
.'// | README \\`.
.'// .-~"""""""~~~~-._ | _,-~~~~"""""""~-. \\`.
.'//.-" `-. | .-' "-.\\`.
.'//______.============-.. \ | / ..-============.______\\`.
.'______________________________\|/______________________________`.