{"id":18814924,"url":"https://github.com/simplymichael/simple-subscription-api","last_synced_at":"2026-01-13T09:30:17.341Z","repository":{"id":233166233,"uuid":"786120594","full_name":"simplymichael/simple-subscription-api","owner":"simplymichael","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-13T18:49:20.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T00:50:39.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplymichael.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T13:50:26.000Z","updated_at":"2024-04-13T18:31:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f79990e0-f9ae-4af3-8544-6ed0ba2fac64","html_url":"https://github.com/simplymichael/simple-subscription-api","commit_stats":null,"previous_names":["simplymichael/simple-subscription-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplymichael%2Fsimple-subscription-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplymichael%2Fsimple-subscription-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplymichael%2Fsimple-subscription-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplymichael%2Fsimple-subscription-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplymichael","download_url":"https://codeload.github.com/simplymichael/simple-subscription-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239750927,"owners_count":19690743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T23:47:01.292Z","updated_at":"2026-01-13T09:30:17.230Z","avatar_url":"https://github.com/simplymichael.png","language":"PHP","readme":"# Simple Subscription\nA simple RESTful API subscription platform which allows users to subscribe to a website.\nWhenever a new post is published on a particular website,\nall its subscribers receive an email with the post title and description in it.\n\n\n## How to run\n### Pre-requisites\n\n### 0. Stack\n- PHP 8.*\n- Laravel 11.*\n- MySQL 8.3.*\n\n### 1. Configure MySQL database\n- Ensure you have a MySQL database up and running.\n- Create a MySQL database using the command `CREATE DATABASE \u003cdatabase_name\u003e`.\n- Copy `.env.example` to `.env`.\n- Update the database environment variable definitions as follows:\n  ```bash\n  DB_CONNECTION=mysql\n  DB_HOST=\u003cmysql_host\u003e\n  DB_PORT=\u003cmysql_port\u003e\n  DB_DATABASE=\u003cdatabase_name\u003e\n  DB_USERNAME=\u003cmysql_username\u003e\n  DB_PASSWORD=\u003cmysql_user_password\u003e\n  ```\n\n### 2. Configure Email\n- Update the email sending environment variable defintiions as follows:\n  ```bash\n  MAIL_MAILER=\u003cmail_mailer_value\u003e\n  MAIL_HOST=\u003cmail_host\u003e\n  MAIL_PORT=\u003cmail_port\u003e\n  MAIL_USERNAME=\u003cmail_username\u003e\n  MAIL_PASSWORD=\u003cmail_password\u003e\n  MAIL_ENCRYPTION=null\n  MAIL_FROM_ADDRESS=\u003cfrom_address\u003e\n  MAIL_FROM_NAME=\"${APP_NAME}\"\n  ```\n\n### 3. Install dependencies\n- Run `composer install` to install the necessary dependencies.\n\n### 4. Seed the database with websites\n- Run `php artisan db:seed --class=WebsiteSeeder` to seed the database with website.\n\n\n## Available API Routes\n----------------------------------------------------------------------------------------|\n| ROUTE                           | METHOD | Description                                |\n|---------------------------------|--------|--------------------------------------------|\n|`/api/websites`                  | GET    | Get the list of available websites.        |\n|`/api/websites/{id}/posts`       | GET    | Get the posts for a given website.         |\n|`/api/websites/{id}/posts/new`   | POST   | Create a new post for the given website.   |\n|`/websites/{id}/subscribers/new` | POST   | Subscribe a new user to specified website. |\n\n\n## Creating a new post\nTo create a new post, you have to have to know the website that the post belongs to.\nSo, do the following:\n- Send a GET request to: `/api/websites` to get the list of available websites.\n- Copy the ID of the website for which you want to create a post.\n- Send a POST request to `/api/websites/{id}/posts/new` with the following post body data:\n    - `title` [string] (required): The title of the post\n    - `description` [string] (required): A brief descriptiion of the post.\n    - `body` [string] (required): The body of the post.\n\n## Subscribing a new user to a post\nTo subscribe a new user to a website,\n- Send a GET request to: `/api/websites` to get the list of available websites.\n- Copy the ID of the website for which you want to subscribe a user.\n- Send a POST request to `/api/websites/{id}/subscribers/new` with the following post body data:\n  - `subscriber_email` [string] (required): The email of the user to subscribe\n  - `subscriber_name` [string] (optional): The name of the user to subscribe.\n\n\n## Sending out (or queueing) notifications of published posts\n- Run the custom command `php artisan app:process-notifications` to queue notifications of published posts.\n\n## Processing the queue\n- Run `php artisan queue:work` to process the queued notifications.\n\n\n## SAMPLE POSTMAN COLLECTION\nA sample postman collection has been included and is located at\n\u003ca href=\"simple-subscription.postman_collection.json\"\u003esimple-subscription.postman_collection.json\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplymichael%2Fsimple-subscription-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplymichael%2Fsimple-subscription-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplymichael%2Fsimple-subscription-api/lists"}