# 🛍️ Test Project: Module B — ShopPress (Online Shopping Mall) ## 1. Project Overview In the rapidly growing e-commerce market, the startup **ShopPress** is launching its own shopping mall platform that allows administrators to manage products and orders directly. Administrators can register and manage products and process orders, while general visitors can browse and purchase products. In this project, competitors are responsible for everything from database design to core feature implementation. This is an MVP, so focus on implementing the essential functionality. **Design is not a graded criterion.** --- ## 2. Tech Stack & Constraints * **Tech Stack**: There are no restrictions on programming language or framework. You may freely choose any server-side rendering (SSR)-capable framework such as Laravel, Django, Ruby on Rails, or Spring Boot. * **Desktop Environment**: Responsive design is not required. The application only needs to work in a desktop Chrome browser. * **Image Upload**: Product images must be JPG or PNG format only, with a file size limit of **5MB**. This validation must be performed **server-side**. * **Database**: Categories must be managed in a separate table (`categories`). The products table (`products`) must reference `category_id` as a foreign key (FK). * **Initial Data**: The following data must be created automatically on first run (via Seeder or Migration). * Admin account: Name `Admin`, Email `admin@shoppress.local`, Password `password` (password must be stored as a hash) * At least 3 initial categories (e.g., `Clothing`, `Electronics`, `Food`) --- ## 3. Tasks to Complete ### **1. Authentication** #### 1.1 Login and Session Management The login page is accessible at `/admin/login`. The user enters their email and password. On successful login, the user is redirected to the admin dashboard. On failure, display the message **"Incorrect email or password."** Accessing any route under `/admin` without being logged in redirects the user to the login page. Logging out destroys the session and redirects to the login page. The currently logged-in admin's name must be displayed in the navigation on all admin pages. --- ### **2. Admin Features** #### 2.1 Dashboard The dashboard is the default admin page (`/admin` or `/admin/dashboard`) and is the first page shown after login. Display the following 4 statistics as cards on the dashboard. | Card Label | Content | | :--- | :--- | | **Total Products** | Total number of products | | **Active Products** | Number of products with status `Active` | | **Total Orders** | Total number of orders | | **Total Revenue** | Sum of all final payment amounts (after coupon discounts) | Also display a list of the 5 most recently placed orders. Each row must include: Order # , Customer, Total, Status, and Date. #### 2.2 Product Management The product management page (`/admin/products`) displays all products in a table. Table columns: **Name**, **Category**, **Price**, **Stock**, **Status**, **Created At**, Edit / Delete buttons. Provide a search field to filter products by name. Submitting a search term displays only products whose name contains that keyword. The **product registration form** (`/admin/products/new`) and **product edit form** (`/admin/products/{id}/edit`) must include the following fields. * **Name** (required, max 100 characters) * **Category** (required, dropdown — populated from categories in the database) * **Price** (required, integer, 0 or greater) * **Stock** (required, integer, 0 or greater) * **Description** (`