A database for Database class.
- Trần Tuấn Thịnh - 20020265
- Quách Ngọc Minh - 20020261
- Nguyễn Việt Hoàng - 20020196
- npm and yarn 1.x
Use PostgreSQL database with TypeORM for querying
- Customer Table is where we store customers' information. There are 5 different rows which are id, first name, last name, balance and phone number
- Order Table is where we store orders' information. We can see each each orders' id, customerID, storeID, date, and total price of the order.
- In OrderDetails, we include details for each order. For example, a customer has 1 order with 2 difference product, this table will dispay each item price.
- Next is the Product Table, we have products' name, price for each of them, and the cost of each product. We also separate each product into it own category and keep track of their inventory.
- In the Store Table, we include the location of each store, total revenue in each store and the cost it took to operate.
- Go to the SupplierDetails Table, we have suppliers' information and their transaction with the shop.
- Lastly, in the suppliers Table, we have the supplier basic information like name and the total amount of money paid for each supplier
If you want to run this database locally then do the following
- Clone this github repo to your local machine
- Create an empty database name coffee in your PostgreSQL database
- Open a terminal at api folder, run
copy env.example .env
and change corresponding variable to match your local database - Still at that terminal, run
yarn
to install all dependencies andyarn run migration:run
to import data to your database - Run the server with
yarn start:prod
- Link to our frontend https://github.com/Mint18032/coffeeShop with preview
- Documentation for API https://whatever-coffee-shop.herokuapp.com/api/docs/