Welcome to my repository for Aquadic task implemented using Laravel version 10.
This is an API of essential e-commerce functionalities, providing features such as user authentication (Login, Register, Logout) based on token authentication, order placement, and email notifications upon ordering. The product requirement mandated support for multiple colors and discount options. 1-Minute Preview Video on Youtube
Note: Before you begin, make sure you have the following prerequisites installed on your system:
These tools are essential for setting up and running the application. If you don't have them installed, you can download and install them from the provided links.
Once the prerequisites are in place, follow the installation steps below to set up the project locally.
-
Clone the repository:
git clone https://github.com/edriso/aquadic-ecommerce-api-task.git
-
Navigate to the project directory:
cd aquadic-ecommerce-api-task
-
Install PHP dependencies using Composer:
composer install
-
Copy the example environment file
cp .env.example .env
-
Configure your mail service provider environment variables:
Open the
.env
file in a text editor and locate the mail-related configuration section. Update the following environment variables with your mail service provider's credentials:MAIL_MAILER=smtp MAIL_HOST=your-mail-host MAIL_PORT=your-mail-port MAIL_USERNAME=your-mail-username MAIL_PASSWORD=your-mail-password MAIL_ENCRYPTION=your-mail-encryption MAIL_FROM_ADDRESS=[email protected] MAIL_FROM_NAME="${APP_NAME}"
Ensure that you replace placeholders like
your-mail-host
,your-mail-port
,your-mail-username
,your-mail-password
, andyour-mail-encryption
with the actual values provided by your mail service provider.If you are using a testing service like Mailtrap during development, replace the values accordingly. For production, update these settings based on the mail service you are using.
Save the changes to the
.env
file. -
Run database migrations to set up the necessary tables:
php artisan migrate
-
Start the Laravel development server:
php artisan serve
-
In a separate terminal, run the following command to start the queue worker (necessary for email notifications to clients when placing an order):
php artisan queue:work
This command ensures that the notification tasks, including sending emails to affected clients, are handled in the background, providing a seamless and responsive experience for clients. Keep the queue worker running to continually process queued jobs and deliver timely notifications.
-
Database Setup:
Run database migrations and seed data to populate the database:
php artisan migrate --seed
-
API Testing:
Open Postman, and import the provided collection (located in
readme-files/aquadic-ecommerce-api.postman_collection.json
). The collection includes a set of pre-configured API endpoints for testing various features of the e-commerce application. Utilize this tool to simulate requests, inspect responses, and ensure the proper functioning of your API. -
Authentication:
-
Login or Register: Start with the
Login
orRegister
request from the collection. Copy the token from the response. -
Bearer Token: Paste the copied token in the
Authorization
header as a bearer token for subsequent requests.
-
- Implement Filament for the admin dashboard to manage and insert products.