Skip to content

ChampiMagic/Kantina-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 

Repository files navigation

Logo

Kantina App

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.

API and Client startup instruction

First, install all dependencies with npm (In their respective folders)

  npm install 

Second, run the API with:

  npm run dev

For the Client use:

  npm start

API Environment Variables

To run this project, you will need to add the following environment variables to your .env file in "API" folder.

MONGODB VARIABLES:

DB_GETWAY

PORT

JSONWEBTOKEN VARIABLES:

SECRET_WORD

AWS S3 VARIABLES:

AWS_BUCKET_NAME

AWS_BICKET_REGION

AWS_ACCESS_KEY

AWS_SECRET_KEY

STRIPE VARIABLES:

PUBLISHABLE_KEY

SECRET_KEY

Client Environment Variables

Also you will need to add the following environment variables to your .env file in "Client" folder.

SERVER VARIABLES:

BACKEND_URL

STRIPE VARIABLES:

PUBLISHABLE_KEY

API Reference

NOTE: Protected routes needs a Token. Token have to be sended by Header with the Follow form: Bearer token

AUTHENTICATION CONTROLLERS

  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.

USER CONTROLLERS

  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

PRODUCT CONTROLLERS

  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.

PURCHASE CONTROLLERS

  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.

AWS S3 CONTROLLERS

  GET /api/privateAWS/:key
Params Type Protected Description
key string true Key (id) of the image to be searched.

STRIPE CONTROLLERS

  POST /api/privateStripe/
Body Type Protected Description
amount integer true Amount payable in the lowest value of the currency.
currency integer true actual currency.

Screenshots

App Home

App Navigation

App Profile

About

Mini Ecommerce App

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors