Project Summary
The Shopping List API is a robust web service designed to facilitate the creation and management of
shopping lists for users. Built with Laravel and utilizing Laravel Sanctum for
secure authentication, this API allows users to:
- Register and Log In: Users can create accounts with unique usernames and passwords, enabling
secure access to their shopping lists.
- Manage Shopping Lists: Authenticated users can create, view, and update their shopping lists,
which can contain multiple items.
- Add and Manage Items: Users can add items to their shopping lists, specifying details like
name, description, quantity, and unit cost.
- Share Shopping Lists: Users can grant permissions to other users, allowing them to add items to
their lists, fostering collaboration and shared grocery shopping experiences.
- Secure Logout: Users can securely log out, ensuring that their sessions are properly
terminated.
1. Functional Requirements
2. Non-Functional Requirements
- Performance: The API should handle at least 100 concurrent users with a response time of less
than 300 ms.
- Scalability: The API should be designed to scale horizontally.
- Security: The API should use token-based authentication (e.g., Sanctum, JWT) to protect
endpoints.
Technical Specifications
3. Database Schema
Tables Overview
- users: Store user information.
- shopping_lists: Store shopping list details.
- items: Store item details.
- shopping_list_items: A pivot table to track which items are in which shopping lists.
- shopping_list_user: A pivot table to manage permissions for shared shopping lists.
4. API Endpoints Summary
GET|HEAD api/items
POST api/items
POST api/items/bulk
PUT api/items/{id}
DELETE api/items/{id}
POST api/login
POST api/logout
POST api/register
GET|HEAD api/shopping-lists
POST api/shopping-lists
GET|HEAD api/shopping-lists/{listId}
PUT api/shopping-lists/{listId}
DELETE api/shopping-lists/{listId}
POST api/shopping-lists/{listId}/share
DELETE api/shopping-lists/{listId}/unshare
GET|HEAD api/user
GET|HEAD api/users/{userId}
PUT api/users/{userId}
DELETE api/users/{userId}