Make sure you have NodeJS (>8.12.0), NPM (>6.4.1), and PostgreSQL (>10.5) installed.
git clone https://github.com/akhilome/fast-food-fast.git && cd fast-food-fast
npm i
Rename the .env.example
file to .env
and replace the placeholders with valid data.
With your database server running and you being in the project's root directory run the follow commands.
npm run config-db && npm run seed-db
npm run setup-testdb
npm start
then access any of the endpoints listed below
Endpoint | Functionality | Notes |
---|---|---|
POST /auth/signup | Registers a User | |
POST /auth/login | Login a user | |
POST /orders | Place an order for food | |
GET /users/<userId>/orders | Get the order history for a particular user. | |
GET /menu | Get available menu | |
POST /menu | Add an new meal to db | Only admins can use this route |
GET /orders | Get all customer orders | Only admins can use this route |
GET /orders/<orderId> | Get the details of a specific order | Only admins can use this route |
PUT /orders/<orderId> | Update the status of an order | Only admins can use this route |
{
"name": "User's name",
"email": "User's valid email",
"password": "A password longer than 6 chars",
"confirmPassWord": "The above password, again",
"adminSecret": "secret key for signing up admins [optional]"
}
{
"email": "valid email address",
"password": "valid password"
}
{
"foodIds": [1, 2, 3]
}
{
"foodName": "Name of new food",
"foodImage": "URL of food image",
"price": "Numeric price of food item"
}
{
"status": "new status"
}
Note: the status
passed to this route should be either of:
complete
processing
cancelled
Having setup the testdb above (npm run setup-testdb
) you can run the test locally by running ...
npm test
... from the command line
- UI Templates => GitHub Pages
- API => Heroku
- API docs => Apiary