diff --git a/.env.example b/.env.example index 89e9463..e7d65c5 100644 --- a/.env.example +++ b/.env.example @@ -7,6 +7,7 @@ APP_URL=http://localhost # Wall-clock times from the admin UI (datetime-local) are interpreted in this zone. APP_TIMEZONE=Europe/Amsterdam +# Use nl for Dutch public UI (lang/nl.json + lang/nl/*). Admin uses the same locale when set. APP_LOCALE=en APP_FALLBACK_LOCALE=en APP_FAKER_LOCALE=en_US diff --git a/README.md b/README.md index 5ad1377..fd725b1 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,131 @@ -
+# PreRegister - +Laravel 11 app for festival **ticket pre-registration**: branded public landing pages, local subscriber storage, and optional sync to [Mailwizz](https://www.mailwizz.nl/) (API key per page, encrypted at rest). -## About Laravel +## Tech stack -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: +| Layer | Choice | +|--------|--------| +| Backend | PHP 8.2+, Laravel 11, MySQL 8 | +| Frontend (public + admin) | Blade, Tailwind CSS 3, Alpine.js 3 | +| Auth | Laravel Breeze (Blade stack) | +| Queue | Database driver; Mailwizz sync on `mailwizz` queue | -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). +**Not used:** React, Vue, Livewire, or Inertia. -Laravel is accessible, powerful, and provides tools required for large, robust applications. +## Requirements -## Learning Laravel +- PHP ≥ 8.2 (extensions: mbstring, xml, curl, pdo_mysql, gd) +- Composer ≥ 2.7 +- Node.js ≥ 20 (for Vite / Tailwind) +- MySQL 8 (local or Docker) -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. +## Local setup -In addition, [Laracasts](https://laracasts.com) 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. +1. **Clone and install PHP dependencies** -You can also watch bite-sized lessons with real-world projects on [Laravel Learn](https://laravel.com/learn), where you will be guided through building a Laravel application from scratch while learning PHP fundamentals. + ```bash + composer install + ``` -## Agentic Development +2. **Environment** -Laravel's predictable structure and conventions make it ideal for AI coding agents like Claude Code, Cursor, and GitHub Copilot. Install [Laravel Boost](https://laravel.com/docs/ai) to supercharge your AI workflow: + ```bash + cp .env.example .env + php artisan key:generate + ``` -```bash -composer require laravel/boost --dev + Configure database (example for Docker MySQL on localhost): -php artisan boost:install -``` + ```env + DB_CONNECTION=mysql + DB_HOST=127.0.0.1 + DB_PORT=3306 + DB_DATABASE=preregister + DB_USERNAME=preregister + DB_PASSWORD=preregister -Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices. + QUEUE_CONNECTION=database + ``` -## Contributing + Mailwizz API keys are **not** in `.env`; they are stored per pre-registration page in the database (encrypted). -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). +3. **Docker (optional)** -## Code of Conduct + From the project root: -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). + ```bash + make up + # or: docker compose up -d + ``` -## Security Vulnerabilities + See [documentation/Setup.md](documentation/Setup.md) for MySQL, Mailpit, and phpMyAdmin ports. -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. +4. **Database** + + ```bash + php artisan migrate --seed + ``` + +5. **Storage link (uploads)** + + ```bash + php artisan storage:link + ``` + +6. **Frontend build** + + ```bash + npm install + npm run build + # or during development: npm run dev + ``` + +7. **Run the app** + + ```bash + php artisan serve + ``` + + Admin UI lives under `/admin` (after login). Public pre-registration URLs are `/r/{uuid-slug}`. + +8. **Queue worker (Mailwizz sync)** + + ```bash + php artisan queue:work --queue=mailwizz + ``` + + Use Supervisor or your host’s process manager in production. + +## Default login (after seed) + +`php artisan db:seed` creates a **superadmin** (via `SuperadminSeeder`): + +- Email: `admin@preregister.app` +- Password: `changeme123!` + +Change this password immediately in any shared or production environment. Additional users are created by a superadmin in **Admin → Users**. Sign in at `/login`. + +## Deployment notes + +- Run `php artisan migrate` (and `--seed` only on first deploy if you rely on seed data). +- Run `php artisan storage:link` so `public/storage` serves uploaded backgrounds and logos. +- Run a queue worker on the `mailwizz` queue (or `queue:work` without `--queue` if you only use the default queue and push jobs there consistently). +- Set `APP_KEY`, use HTTPS behind a reverse proxy, and configure `APP_URL` correctly. +- Optional: cron for `* * * * * php /path/to/artisan schedule:run` if you add scheduled tasks. + +More detail: [documentation/DEPLOYMENT-STRATEGY.md](documentation/DEPLOYMENT-STRATEGY.md). + +## Product specification + +Full functional spec and development sequence: [documentation/Pregister-Development-Prompt.md](documentation/Pregister-Development-Prompt.md). + +## Security + +- Public subscribe endpoint is rate limited (`throttle:10,1`). +- CSRF on web forms; policies for admin resources. +- Never expose Mailwizz API keys in responses, logs, or the browser. ## License -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +Application code follows your project’s license. Laravel is open source under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 6916409..ce0daa4 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -1,5 +1,7 @@ Hash::make($validated['password']), ]); - return back()->with('status', 'password-updated'); + return back()->with('status', __('Password updated successfully.')); } } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 3e5185e..14a539f 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -1,5 +1,7 @@ user()->save(); - return Redirect::route('admin.profile.edit')->with('status', 'profile-updated'); + return Redirect::route('admin.profile.edit')->with('status', __('Profile updated successfully.')); } /** diff --git a/app/Http/Requests/SubscribePublicPageRequest.php b/app/Http/Requests/SubscribePublicPageRequest.php index c04a41f..ce80c6d 100644 --- a/app/Http/Requests/SubscribePublicPageRequest.php +++ b/app/Http/Requests/SubscribePublicPageRequest.php @@ -32,6 +32,19 @@ class SubscribePublicPageRequest extends FormRequest ]; } + /** + * @return array{{ __('Page:') }} {{ $page->title }}
+ @if ($errors->any()) +{{ __('Please fix the following:') }}
+{{ __('Integration active') }}
diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php index d9a1158..302da49 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/layouts/admin.blade.php @@ -13,6 +13,47 @@ @vite(['resources/css/app.css', 'resources/js/app.js']) + @php + $adminFlashSuccess = session('status'); + $adminFlashError = session('error'); + @endphp + @if ($adminFlashSuccess !== null || $adminFlashError !== null) +{{ $toast['message'] }}
+ +{{ __('Update your account settings and password.') }}
+{{ __('Saved.') }}
- @endif{{ __('Saved.') }}
- @endif