Skip to content

vicmans/catalog-products

Repository files navigation

Product Catalog with Newsletter Subscription

This project is a Laravel application that serves as a product catalog. Provide an API to browse products and categories, subscribe to a newsletter, and receive updates about featured products.

Features

  • Browse products and categories
  • Filter products and categories by name
  • View products and categories by slug
  • Subscribe and unsubscribe to newsletters
  • Receive a welcome email upon subscription
  • Weekly newsletter with featured products
  • Admin panel to manage products and categories

Requirements

  • PHP >= 8.2
  • Composer
  • Laravel >= 11.x
  • MySQL or any supported database

Installation

Follow these steps to set up and run the project locally.

1. Clone the Repository

2. Install Dependencies

Run the following command to install the required packages:

composer install

3. Set Up Environment File

Copy the example environment file:

cp .env.example .env

Then, update the .env file with your database credentials and mail configuration.

Generate an application key:

php artisan key:generate

4. Initialize the Application

To run migrations and optionally seed the database, you can use the custom Artisan command:

php artisan app:init

This command will:

  • Run all migrations.
  • Prompt you to run seeders.
  • Ask for an email and password to create a new user.

5. Start the Development Server

Run the following command to start the development server:

php artisan serve

You can now access the application at http://localhost:8000.

To send newsletters weekly, set up a cron job to run the Laravel scheduler or run the queue worker:

API Endpoints

Categories

  • List Categories: GET /api/categories?name=example
  • View Category by Slug: GET /api/categories/slug/{slug}

Products

  • List Products: GET /api/products?name=example
  • View Product by Slug: GET /api/products/slug/{slug}

Subscribers

  • Subscribe: POST /api/subscribe (requires an email)
  • Unsubscribe: POST /api/unsubscribe (requires an email)

Admin panel

You can access to the admin panel /admin

Technologies Used

  • Laravel
  • PHP
  • MySQL
  • Blade (for views)
  • Eloquent ORM
  • Filament (Admin panel)

License

This project is licensed under the MIT License.

About

Product Catalog API with Newsletter Subscription

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages