Skip to content

Commit 8a93a1d

Browse files
authored
Merge pull request #89 from OpenDash-Team/feature/frontend
M2 Frontend: Login, Register, Cart, Account, Orders
2 parents 9116ac6 + f023adc commit 8a93a1d

49 files changed

Lines changed: 1068 additions & 70 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.docker.example‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Backend
22
backend/.venv
3-
backend/data
3+
data
44
__pycache__
55
.env
66
.env.*

‎Dockerfile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ COPY --from=frontend-build /frontend/dist ./frontend/
3838
# Port of the webserver
3939
EXPOSE 8000
4040

41+
# Standard linux user and group
42+
USER 1000:1000
43+
4144
# Start the FastAPI application
4245
CMD ["uvicorn", "backend.main:main", "--host", "0.0.0.0", "--port", "8000"]

‎compose.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ services:
22
app:
33
build: .
44
container_name: openeats
5-
env_file:
6-
- .env.docker
5+
environment:
6+
JWT_SECRET_KEY: "openeats-local-testing-secret-key-12345"
77
ports:
88
- "8000:8000"
99
volumes:

‎docs/PROVENANCE.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,14 @@ Entry 13
125125
- Purpose: To implement trials and error messages
126126
- Influence: Used and adapted the generated implementation.
127127
- Validation: Manual checking, unit tests, and teammate review
128-
- PR: #85
128+
- PR: #85
129+
130+
Entry 14
131+
- Student(s): Rameez
132+
- Artifact: frontend/src/api/fetchOrders.ts; frontend/src/pages/OrdersPage.tsx; frontend/src/components/orders_page/OrderCard.tsx
133+
- Label: AI-GENERATED
134+
- AI tool: Codex
135+
- Purpose: To quickly integrate the orders page with the backend endpoint.
136+
- Influence: Codex implemented the API function, called the function on the orders page and returned the data.
137+
- Validation: Manual checking and teammate review
138+
- PR: #89

‎frontend/src/api/addCartItem.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { request } from "./request";
2+
3+
export async function addCartItem(menuItemId: string, quantity: number): Promise<Cart> {
4+
return request<Cart>("/cart/items", {
5+
method: "POST",
6+
headers: { "Content-Type": "application/json" },
7+
body: JSON.stringify({ menuItemId, quantity }),
8+
});
9+
}

‎frontend/src/api/checkout.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { request } from "./request";
2+
3+
export async function checkout(): Promise<Order> {
4+
return request<Order>("/checkout", { method: "POST" });
5+
}

‎frontend/src/api/clearCart.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { request } from "./request";
2+
3+
export async function clearCart(): Promise<Cart> {
4+
return request<Cart>("/cart", { method: "DELETE" });
5+
}

‎frontend/src/api/deleteCustomer.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { request } from "./request";
2+
3+
export async function deleteCustomer(): Promise<void> {
4+
return request<void>("/customers/me", { method: "DELETE" });
5+
}

‎frontend/src/api/fetchCart.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { request } from "./request";
2+
3+
export async function fetchCart(): Promise<Cart> {
4+
return request<Cart>("/cart");
5+
}

0 commit comments

Comments
 (0)