Submitted by: Andrey Fernandez
- Database Creation: Set up a Postgres database to store information about products and orders.
- Use the provided schema to create tables for
products
,orders
, andorder_items
.
- Use the provided schema to create tables for
- Products Model: Develop a model to represent individual items available in the store.
- This model should include attributes such as
id
,name
,description
,price
,image_url
, andcategory
. - Implement methods for CRUD operations on products.
- Ensure transaction handling for the deletion of products to also delete related
order_items
- This model should include attributes such as
- Orders Model: Develop a model to manage orders.
- This model should include attributes such as
order_id
,customer_id
,total_price
,status
, andcreated_at
. - Implement methods for creating, fetching, updating, and deleting orders.
- Ensure transaction handling for the deletion of orders to also delete related
order_items
- This model should include attributes such as
- Order Items Model: Develop a model to represent the items within an order.
- This model should include attributes such as
order_item_id
,order_id
,product_id
,quantity
, andprice
. - Implement methods for fetching and creating order items.
- This model should include attributes such as
- API Endpoints
- Product Endpoints:
-
GET /products
: Fetch a list of all products. -
GET /products/:id
: Fetch details of a specific product by its ID. -
POST /products
: Add a new product to the database. -
PUT /products/:id
: Update the details of an existing product. -
DELETE /products/:id
: Remove a product from the database.
-
- Order Endpoints:
-
GET /orders
: Fetch a list of all orders. -
GET /orders/:order_id
: Fetch details of a specific order by its ID, including the order items. -
POST /orders
: Create a new order with order items. -
PUT /orders/:order_id
: Update the details of an existing order (e.g., change status). -
DELETE /orders/:order_id
: Remove an order from the database.
-
- Product Endpoints:
- Frontend Integration
- Connect the backend API to the provided frontend interface, ensuring dynamic interaction for product browsing, cart management, and order placement. Adjust the frontend as necessary to work with your API.
- Added Endpoints
- Create an endpoint for fetching all orders in the database.
- Create an endpoint for serving an individual order based on its ID.
- Filter Orders
- Allow users to use an input to filter orders by the email of the person who placed the order.
- Implement Your Own Frontend
- Build your own user interface for browsing products, managing the shopping cart, and placing orders. This will involve integrating the frontend you create with the backend API you developed during the project.
- Past Orders Page
- Build a page in the UI that displays the list of all past orders. The user should be able to click on any individual order to take them to a more detailed page of the transaction.
https://www.loom.com/share/ed8abeb4868544f1a6b6770b0d074852?sid=c12094e8-1bd2-4ce9-98a4-e6285759845b
- Did the topics discussed in your labs prepare you to complete the assignment? Be specific, which features in your weekly assignment did you feel unprepared to complete?
Yes, the lectures were very helpful. We were taught about prisma, postgres, relational databases, and CRUD operations such as get, post, put, and delete. These were critical to implementing the backend api for the student store. The in class demos also served as a good reference for what a backend api should look like.
- If you had more time, what would you have done differently? Would you have added additional features? Changed the way your project responded to a particular event, etc.
If I had more time, I would have liked to display a receipt of the order after it has been placed underneath the cart. I would also have liked to change the styling or structure of the frontend.
- Reflect on your project demo, what went well? Were there things that maybe didn't go as planned? Did you notice something that your peer did that you would like to try next time?
My project demo went well. Despite the project being backend focused, there was still plenty to show in the presentation. Having my postman endpoints well organized helped to present the efficiently. Using prisma studio for proving my checkout created an order with the selected items was also helpful. I felt comfortable presenting and was able to project my voice.
N/A
Shoutout Devarsh for helping me throughout the project.