|
1 | | -<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p> |
| 1 | +````markdown |
| 2 | +# Simple Campaign Manager |
2 | 3 |
|
3 | | -<p align="center"> |
4 | | -<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a> |
5 | | -<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a> |
6 | | -<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a> |
7 | | -<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a> |
8 | | -</p> |
| 4 | +Alhamdulillah! This is a minimal yet fully functional email campaign manager built with *Laravel*, *React*, *InertiaJS*, and *shadcn/ui*. |
| 5 | +It allows you to manage contacts, create campaigns, and track per-recipient delivery status in a clean, organized, and scalable way. |
9 | 6 |
|
10 | | -## About Laravel |
| 7 | +--- |
11 | 8 |
|
12 | | -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: |
| 9 | +## Features |
13 | 10 |
|
14 | | -- [Simple, fast routing engine](https://laravel.com/docs/routing). |
15 | | -- [Powerful dependency injection container](https://laravel.com/docs/container). |
16 | | -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. |
17 | | -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). |
18 | | -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). |
19 | | -- [Robust background job processing](https://laravel.com/docs/queues). |
20 | | -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). |
| 11 | +- Pre-seeded contacts (name + email) |
| 12 | +- Contacts table with selection: single, multiple, or select all |
| 13 | +- Create Campaigns: enter subject & body, select recipients |
| 14 | +- Queue-based sending (simulated) per recipient |
| 15 | +- Track per-recipient status: `pending`, `sent`, `failed` |
| 16 | +- Campaign history & per-campaign delivery results |
| 17 | +- Clean architecture: Actions, Services, Queued Jobs |
| 18 | +- React components organized by page & reusable presentational components |
| 19 | +- Accessible, Material-style UI using *shadcn/ui* |
21 | 20 |
|
22 | | -Laravel is accessible, powerful, and provides tools required for large, robust applications. |
| 21 | +--- |
23 | 22 |
|
24 | | -## Learning Laravel |
| 23 | +## Architecture Choices |
25 | 24 |
|
26 | | -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application. |
| 25 | +- Separation of concerns |
| 26 | + Controllers remain thin; `CreateCampaignAction` handles creation, `CampaignService` handles sending. |
27 | 27 |
|
28 | | -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. |
| 28 | +- Pivot table |
| 29 | + `campaign_recipients` stores delivery status and metadata (`failed_reason`, `sent_at`) for each recipient, making reporting simple. |
29 | 30 |
|
30 | | -## Laravel Sponsors |
| 31 | +- Queued Jobs |
| 32 | + Each recipient is handled via a queued job (`SendCampaignEmailJob`), enabling retries and scaling. In this demo, sending is simulated safely. |
31 | 33 |
|
32 | | -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). |
| 34 | +- Inertia + React |
| 35 | + Provides server-side routing with modern React components. Pages are in `pages/`, reusable components in `components/`. |
33 | 36 |
|
34 | | -### Premium Partners |
| 37 | +- UI |
| 38 | + *shadcn/ui + TailwindCSS* for accessible, consistent, and composable UI. Modern and clean design with Material style. |
35 | 39 |
|
36 | | -- **[Vehikl](https://vehikl.com)** |
37 | | -- **[Tighten Co.](https://tighten.co)** |
38 | | -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** |
39 | | -- **[64 Robots](https://64robots.com)** |
40 | | -- **[Curotec](https://www.curotec.com/services/technologies/laravel)** |
41 | | -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** |
42 | | -- **[Redberry](https://redberry.international/laravel-development)** |
43 | | -- **[Active Logic](https://activelogic.com)** |
| 40 | +- Validation |
| 41 | + Laravel FormRequest ensures request data integrity before executing actions. |
| 42 | +```` |
| 43 | +## Setup Instructions (Local) |
| 44 | +### 1. Clone Repository |
44 | 45 |
|
45 | | -## Contributing |
| 46 | +```bash |
| 47 | +git clone git@github.com:ProgrammerHasan/simple-campaign-manager.git |
| 48 | +cd simple-campaign-manager |
| 49 | +``` |
46 | 50 |
|
47 | | -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). |
| 51 | +### 2. Install Backend Dependencies |
48 | 52 |
|
49 | | -## Code of Conduct |
| 53 | +```bash |
| 54 | +composer install |
| 55 | +cp .env.example .env |
| 56 | +# configure DB credentials in .env |
| 57 | +php artisan key:generate |
| 58 | +``` |
50 | 59 |
|
51 | | -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). |
| 60 | +### 3. Install Frontend Dependencies |
52 | 61 |
|
53 | | -## Security Vulnerabilities |
| 62 | +```bash |
| 63 | +npm install |
| 64 | +``` |
54 | 65 |
|
55 | | -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. |
| 66 | +### 4. Run Migrations & Seed Contacts |
56 | 67 |
|
57 | | -## License |
| 68 | +```bash |
| 69 | +php artisan migrate |
| 70 | +php artisan db:seed --class=ContactSeeder |
| 71 | +``` |
58 | 72 |
|
59 | | -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
| 73 | +### 5. Configure Queue (for simulated sending) |
| 74 | + |
| 75 | +```bash |
| 76 | +# .env |
| 77 | +QUEUE_CONNECTION=database |
| 78 | +``` |
| 79 | + |
| 80 | +### 6. Run Worker (in a separate terminal) |
| 81 | + |
| 82 | +```bash |
| 83 | +php artisan queue:work |
| 84 | +``` |
| 85 | + |
| 86 | +> For quick development, set `QUEUE_CONNECTION=sync` (jobs run immediately without queue). |
| 87 | +
|
| 88 | +### 7. Run Dev Servers |
| 89 | + |
| 90 | +```bash |
| 91 | +# All-in-one (recommended) |
| 92 | +composer run dev |
| 93 | + |
| 94 | +# Or separately: |
| 95 | + |
| 96 | +# Backend |
| 97 | +php artisan serve |
| 98 | + |
| 99 | +# Frontend |
| 100 | +npm run dev |
| 101 | +```` |
| 102 | +> This makes it clear that `composer run dev` can start both backend and frontend simultaneously. |
| 103 | + |
| 104 | +### 8. Access the App |
| 105 | + |
| 106 | +Open [http://127.0.0.1:8000](http://127.0.0.1:8000) |
| 107 | + |
| 108 | +--- |
| 109 | +> Alhamdulillah, the application is now running. May it be beneficial and easy to use, Insha’Allah. |
| 110 | + |
| 111 | +If you face any issues or need assistance, feel free to contact me on WhatsApp: [+8801625568604](https://wa.me/8801625568604?text=I%20am%20facing%20an%20issue%20with%20the%20Simple%20Campaign%20Manager%20project) |
| 112 | + |
| 113 | +May Allah make this project beneficial for all, Insha’Allah. |
0 commit comments