Skip to content

Commit 1775e87

Browse files
committed
Create TODO.md
1 parent c3ccaec commit 1775e87

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

TODO.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Project Review & TODOs: Laravel Vue E-commerce
2+
3+
## Overall Assessment
4+
5+
The project uses a modern stack (Laravel 10, Vue 3) and follows generally good practices for an SPA with a backend API. It has a solid foundation for an e-commerce application. The frontend utilizes Pinia for state management and Vue Router, with components generally following good practices. Data fetching is handled both by Pinia actions and directly in components using `useSWRV`.
6+
7+
## Critical TODOs
8+
9+
- [ ] **Implement `CategoryController` Methods:**
10+
- The `app/Http/Controllers/Api/CategoryController.php` is currently empty.
11+
- Implement `index()` method to list all categories.
12+
- Implement `show()` method to display a single category by its slug or ID.
13+
- Ensure these methods fetch data from the `Category` model and return appropriate JSON responses.
14+
- [ ] **Fix `checkout(product)` Call in `OrderCheckout.vue`:**
15+
- The `@click` handler for the "Submit order" button in `resources/js/components/Checkout/OrderCheckout.vue` calls `checkout(product)`, but `product` is not defined in the component's scope.
16+
- Change to `checkout()`.
17+
- [ ] **Correct `paymentIsProcessing` Logic in `OrderCheckout.vue`:**
18+
- In `resources/js/components/Checkout/OrderCheckout.vue`, `localState.paymentIsProcessing` is incorrectly set to `false` at the beginning of the `checkout()` method.
19+
- It should be set to `true` when the payment process starts and then to `false` in both the `.then()` and `.catch()` blocks of the Axios call.
20+
- [ ] **Define `placeholderImage` in `SingleProduct.vue`:**
21+
- The `resources/js/components/Products/SingleProduct.vue` component attempts to use an undefined `placeholderImage`.
22+
- Define this variable (e.g., import a local image asset or set a URL string) or remove its usage if a placeholder is not desired.
23+
24+
## High Priority TODOs
25+
26+
- [ ] **Refine User Creation on Purchase (`UserController@purchase`):**
27+
- Currently creates a user with a random password if email doesn't exist.
28+
- Consider options:
29+
- Clearly inform the user an account is being created.
30+
- Send a welcome email with a password reset link or temporary password.
31+
- Offer a distinct "guest checkout" that doesn't create a full user account or makes it optional.
32+
- [ ] **Add Input Validation to Laravel Controllers:**
33+
- Ensure all incoming request data in API controllers (e.g., `UserController@purchase`, `ProductController`, `CategoryController`) is thoroughly validated using Laravel's validation features.
34+
- [ ] **Improve Error Handling in `UserController@purchase`:**
35+
- Avoid exposing raw exception messages directly to the client.
36+
- Log detailed errors on the server.
37+
- Return user-friendly and distinct error messages for different failure scenarios.
38+
- [ ] **Initialize `products` State in Pinia Store (`useCart.js`):**
39+
- The `products` array in `resources/js/store/useCart.js` is used by actions/getters but not explicitly initialized in the `state` object.
40+
- Add `products: []` to the initial state.
41+
- [ ] **Correct Order ID Saved in `OrderCheckout.vue`:**
42+
- The `checkout()` method in `OrderCheckout.vue` saves `paymentMethod.id` as the order ID.
43+
- It should save the actual order ID from the backend response (e.g., `response.data.id` or `response.data.transaction_id`).
44+
45+
## Medium Priority TODOs
46+
47+
- [ ] **Expand Test Coverage:**
48+
- Write more comprehensive tests for backend API endpoints (PHPUnit).
49+
- Write more frontend tests for Vue components and user interactions (Jest, Vue Testing Library).
50+
- [ ] **Review and Enhance Security (General):**
51+
- Conduct a general security review (input validation, XSS, CSRF, SQLi, sensitive data exposure).
52+
- [ ] **Review Data Fetching Strategy (Vue):**
53+
- Product data is fetched via `useSWRV` in components (`ShowAllProducts`, `SingleProduct`) and also via an action in the Pinia store (`getProductsFromApi`).
54+
- Decide on a consistent strategy: either centralize in Pinia or ensure components using `useSWRV` don't conflict with store logic if the store is intended as the single source of truth for product lists.
55+
- [ ] **Improve Error Display in Vue Components:**
56+
- `SingleProduct.vue` could display an error message if product fetching fails.
57+
- Error messages in `OrderCheckout.vue` could be more specific and user-friendly.
58+
- [ ] **Adjust `formatPrice` for Decimal Places (if needed):**
59+
- The `formatPrice` utility in `resources/js/utils/functions.js` formats to 0 decimal places.
60+
- If prices can have cents (e.g., $9.99), change `minimumFractionDigits` to `2`.
61+
62+
## Low Priority / Future Growth TODOs
63+
64+
- [ ] **Optimize Vue Component Registration:**
65+
- Consider if global component registration in `resources/js/app.js` impacts initial load time as the app grows.
66+
- [ ] **Improve Project Documentation:**
67+
- Expand `README.md` and consider API documentation.
68+
- [ ] **Frontend UX/UI Review:**
69+
- Conduct a thorough review of the user experience and interface.
70+
- [ ] **Clarify `formatPrice` Export/Import Style:**
71+
- The `formatPrice` utility has both named and default exports. Imports are mixed. Standardize for clarity.
72+
- [ ] **Review Purpose of `<fakevisa-details />`:**
73+
- Clarify the role of this component in `OrderCheckout.vue`. Remove or conditionally render if it's for testing only.
74+
- [ ] **Route Params vs. Props in `SingleProduct.vue`:**
75+
- The component uses `useRoute().params.slug` while the route has `props: true`. Consider using the prop for consistency.
76+
77+
## Questions for Clarification
78+
79+
- [ ] Clarify the meaning of "bot" in the initial project description. If there's specific automated functionality intended, it needs to be reviewed.

0 commit comments

Comments
 (0)