#(name to be confirmed)
A platform to share expensive equipment within trusted groups
- Commppliance
- ESYWTUBNB
- Toolies
- Toolerino
- ToolPool
- GearShare
- Gears of Poor
- The Kitchen Sink
- The Broom Cupboard
- Blender
- Return to Blender
- Nuts & Bolts
- The Broom Cupboard
- Borrowers
- I can sign up
- I can see my profile
- I can add some of my tools to share
- I can view other tools in the Tool Pool
- I can view a particualr tool and see the trust framework for it
- I can request a tool to use (email sent)
- Once accepted, the tools status changes to rented
- Login to view everything
- Profile/Tools available to Share
- Edit Tool Profile/Add a Tool Profile
- Definining Trust Framework
- Browse Tools available to use
- Request a tool to use (email sent)
- Change Tool Status to rented/available
- Multiple Groups (Tool Pools)
- Trust Ratings
- See tools that are currently rented
- Forum to discuss tools/appliances that people needs tips/advice with.
- In app messages
- View others' profiles when you're logged in
- Keeping ToolPool ?anonymus? (proof of id auth)
- Changing profile picture
- Modal for add gear form
name | purpose |
---|---|
Nav | navigation bar |
EditProfileForm | - |
NewGearForm | Form fpr user to add new item of gear |
GearEdit | Form/Modal for editing single item |
GearItem | Full page view of single item |
GearRequest | component for requesting use of too, within GearItem |
ItemInGrid | single item display within GearList or ToolPool |
Login | View for user to enter their login credentials |
Register | View for user to sign up for the App |
Profile | View a logged in user's profile |
GearList | User's view of their own gear |
ToolPool | View all gear in the loaning group |
name | purpose |
---|---|
auth | Store information regarding user logins, auth status and auth errors |
gear | Store the array of all gear and status of any gear fetching/saving |
user | Store user info and array of all gear belonging to logged in user |
Each of these actions calls on several synchrous actions on sending and receiving fetch/save requests to DB
name | data | purpose |
---|---|---|
getGear | all gear | fetches all gear into client |
addGearItem | single item | saves new item to redux state and posts to server for DB saving |
editGearItem | update object | updates item in db and redux state |
setAvailability | id, boolean | sets availability of item in db and state |
loginUser | creds | manages login request |
fetchUser | callback | fetches full user profile from db for state |
logoutUser | - | destroys token client-side to log out |
registerUserRequest | new user form data | creates new user in the server and logs them in in state |
editProfileAction | update object | udpates user profile in db and state |
manageRequest | request object | manages saving emailing new request, saving to db and state in that order |
postRequest | request object | manages saving new request to db and state |
manageMessageDelete | id | manages deleting request from db and state |
manageMessageUpdate | id, update object | manages updating request in db and state |
mailRequest | request object, callback | manages email sending to user |
type | data | purpose |
---|---|---|
GEAR_REQUEST | none | notifying state that gear request is in progress |
SET_GEAR | gear | gear array from response into state |
GEAR_ERROR | err | notifying state of error in fetch |
REQUEST_GEAR_SAVE | none | notifying state that gear push to server is in progress |
GEAR_ADD | item | pushes new item to local state and alters changes saving status to false |
SET_USER | user | saves user info to state on login or register |
Method | Endpoint | Protected | Usage | Request Data | Response |
---|---|---|---|---|---|
Post | /api/auth/login | Yes | Log In a User | credentials object | The Users JWT Token |
Post | /api/auth/register | Yes | Register a User | registration form data | The Users JWT Token |
Get | /api/gear/all | No | Get full list of gear | - | Array of Objects (object = A Gear Item) |
Get | /api/gear/single/:id | No | Get a single gear item | - | A Gear Item |
Post | /api/gear/new | Yes | Add a gear item to db | single gear object | gear item object |
Post | /api/gear/update/:id | Yes | update gear object in DB | update info as an object | numUpdates (should be 1) |
Delete | /api/gear/delete/:id | Yes | delete gear object | - | status 200 |
MVP has two tables -- Gear ( * - 1 ) Users
Column Name | Data Type | Purpose |
---|---|---|
id | increments | Unique identifier for each item |
name | String | name of item |
description | String | Description of item, condition, missing parts etc. |
photo_url | string | URL of a picture of the item |
user_id | integer | Id of the owner |
trustframework | string | loaning category/conditions of item |
status | string | availability of item for use |
Column Name | Data Type | Purpose |
---|---|---|
id | increments | Unique identifier for each user |
user_name | string | Used for login |
first_name | string | First name |
last_name | string | Last name |
profile_pic | string | url of profile picture |
email_address | string | displayed for contact information |
hash | string | hashed login password |
Column Name | Data Type | Purpose |
---|---|---|
id | increments | Unique identifier for each request |
gear_id | integer | id of gear item |
owner_id | integer | id of owner |
last_name | integer | id of requesting user |
created_at | timestamp | timestamp created on insertion into table |
message | string | custom message from requester to owner |
Run the following commands in your terminal:
yarn install
yarn knex migrate:latest
yarn knex seed:run
mv .env_example .env
To run in development:
yarn dev
To run in production:
yarn start
To push master branch to heroku:
yarn h:deploy
Heroku database scripts:
yarn h:migrate
yarn h:seed
yarn h:rollback
heroku config:set JWT_SECRET=somesecret
heroku config:set SENDGRID_API_KEY=key
- You will need pgsql tools, install with
sudo apt-get install -y postgresql-client
- rollback and migrate heroku with yarn h:rollback, yarn h:migrate
- direct connect to heroku postgres db with
heroku pg:psql
- look up seq tables (which keep track of next id val) :
SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';
- For each table run the following reset primary key:
SELECT setval('tablename_id_seq', (SELECT max(id) FROM tablename) + 1);
- close direct db connection with \q
- seed heroku with
yarn h:seed
- repeat steps 3 - 6 to update primary keys