A mobile application created with the aim of making school canteens more efficient. The main idea is that the app would be delivered to each school with a unique ID. Then, students would create an account and make their purchases (breakfast, lunch) directly from the app (there would also be the possibility to make future purchases). And finally, when they arrive at their school canteen, they would show a QR code to the vendor and the vendor would deliver their products.
First, install all dependencies with npm (In their respective folders)
npm install Second, run the API with:
npm run devFor the Client use:
npm startTo run this project, you will need to add the following environment variables to your .env file in "API" folder.
DB_GETWAY
PORT
SECRET_WORD
AWS_BUCKET_NAME
AWS_BICKET_REGION
AWS_ACCESS_KEY
AWS_SECRET_KEY
PUBLISHABLE_KEY
SECRET_KEY
Also you will need to add the following environment variables to your .env file in "Client" folder.
BACKEND_URL
PUBLISHABLE_KEY
NOTE: Protected routes needs a Token. Token have to be sended by Header with the Follow form: Bearer token
POST /api/publicAuth/| Body | Type | Protected | Description |
|---|---|---|---|
email |
string |
false |
Required. Email of the new user. |
name |
string |
false |
Required. Name of the new user. |
password |
string |
false |
Required. Password of the new user. |
genre |
string |
false |
Required. Genre of the new user. It can only be one of these: 'male', 'female', 'other'. |
isStudent |
Boolean |
false |
Required. Indicates whether you are a student or not. |
POST /api/publicAuth/login| Body | Type | Protected | Description |
|---|---|---|---|
email |
string |
false |
Required. Email of the new user. |
password |
string |
false |
Required. Password of the new user. |
GET /api/privateUser/?userId=| Query | Type | Protected | Description |
|---|---|---|---|
userId |
string |
true |
Required. Id of user to search. |
PUT /api/privateUser/update| Body | Type | Protected | Description |
|---|---|---|---|
name |
string |
true |
New username. |
date |
Date |
true |
New birthdate. |
genre |
string |
true |
It can only be one of these: 'male', 'female', 'other'. |
imageKey |
string |
true |
To get the 'imageKey' you need to upload a new image to the Amazon Web Service S3 POST route |
GET /api/privateProduct/?group=| Query | Type | Protected | Description |
|---|---|---|---|
group |
string |
true |
name of a products group. |
GET /api/privateProduct/byName/?name=| Query | Type | Protected | Description |
|---|---|---|---|
name |
string |
true |
name of the product to search. |
GET /api/privateProduct/byId/?id=| Query | Type | Protected | Description |
|---|---|---|---|
id |
string |
true |
id of the product to search. |
GET /api/privateProduct/groups POST /api/privateProduct/| Body | Type | Protected | Description |
|---|---|---|---|
name |
string |
true |
Product name. |
group |
string |
true |
Product group. |
price |
number |
true |
Product Price. |
image |
string |
true |
Product image. |
inStock |
boolean |
true |
determines whether or not there is stock. |
PUT /api/privateProduct/| Body | Type | Protected | Description |
|---|---|---|---|
id |
string |
true |
Product id. |
productData |
object |
true |
New product parameters. |
| productData | Type | Protected | Description |
|---|---|---|---|
name |
string |
true |
Product name. |
group |
string |
true |
Product group. |
price |
number |
true |
Product Price. |
image |
string |
true |
Product image. |
inStock |
boolean |
true |
determines whether or not there is stock. |
DELETE /api/privateProduct/| Query | Type | Protected | Description |
|---|---|---|---|
id |
string |
true |
id of the product to delete. |
POST /api/privatePurchase/| Body | Type | Protected | Description |
|---|---|---|---|
date |
Date |
true |
Date established to consolidate the purchase. |
products |
Array |
true |
Array of objects. |
| products(object) | Type | Protected | Description |
|---|---|---|---|
product |
string |
true |
Id of the product to buy. |
count |
number |
true |
quantity of the same product. |
DELETE /api/privatePurchase/?purchaseId=| Query | Type | Protected | Description |
|---|---|---|---|
purchaseId |
string |
true |
Id of the purchase to delete. |
GET /api/privateAWS/:key| Params | Type | Protected | Description |
|---|---|---|---|
key |
string |
true |
Key (id) of the image to be searched. |
POST /api/privateStripe/| Body | Type | Protected | Description |
|---|---|---|---|
amount |
integer |
true |
Amount payable in the lowest value of the currency. |
currency |
integer |
true |
actual currency. |



