edriso / subscription-platform

Subscription platform API allows users to subscribe to websites and receive email notifications for new posts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscription Platform API

This is a simple subscription platform API built with Laravel. The platform allows users to subscribe to websites and receive email notifications for new posts.

Getting Started

To get started with the project, follow the instructions below.

Prerequisites

  • PHP >= 7.4
  • Composer
  • MySQL

Installation

  1. Clone the repository:
   git clone https://github.com/edriso/subscription-platform.git
  1. Navigate to the project directory:
   cd subscription-platform
  1. Install the dependencies:
composer install
  1. Create a copy of the .env.example file and rename it to .env:
cp .env.example .env
  1. Generate an application key:
php artisan key:generate
  1. Configure your database connection in the .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
  1. Configure your mail connection in the .env file:
MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=your_mailtrap_username
MAIL_PASSWORD=your_mailtrap_password
MAIL_ENCRYPTION=tls
  1. Run the database migrations:
php artisan migrate
  1. Seed the database with sample data (optional):
php artisan db:seed
  1. Start the development server:
php artisan serve
  1. To send post emails to subscribers, run the following command:
php artisan posts:send-emails

This command will check all websites and send new posts to subscribers who haven't received them yet. It ensures that no duplicate stories are sent to subscribers.

  1. This application utilizes queues to handle background processing of tasks such as sending emails. To start processing the queues, run the following command:
php artisan queue:work

About

Subscription platform API allows users to subscribe to websites and receive email notifications for new posts.


Languages

Language:PHP 74.7%Language:Blade 25.0%Language:JavaScript 0.2%