tdmsistemasweb / core-bundle
Symfony bundle with authentication, admin panel, reCAPTCHA, profile management and legal pages
Package info
github.com/tiagomellobr/core-bundle
Type:symfony-bundle
pkg:composer/tdmsistemasweb/core-bundle
Requires
- php: >=8.2
- ext-ctype: *
- ext-iconv: *
- doctrine/doctrine-bundle: ^3.2
- doctrine/doctrine-migrations-bundle: ^4.0
- doctrine/orm: ^3.6
- easycorp/easyadmin-bundle: ^5.0
- phpdocumentor/reflection-docblock: ^6.0
- phpstan/phpdoc-parser: ^2.3
- symfony/ai-platform: ^0.8.1
- symfony/asset: 7.4.*
- symfony/asset-mapper: 7.4.*
- symfony/console: 7.4.*
- symfony/doctrine-messenger: 7.4.*
- symfony/dotenv: 7.4.*
- symfony/expression-language: 7.4.*
- symfony/flex: ^2
- symfony/form: 7.4.*
- symfony/framework-bundle: 7.4.*
- symfony/http-client: 7.4.*
- symfony/intl: 7.4.*
- symfony/mailer: 7.4.*
- symfony/mime: 7.4.*
- symfony/monolog-bundle: ^3.0|^4.0
- symfony/notifier: 7.4.*
- symfony/process: 7.4.*
- symfony/property-access: 7.4.*
- symfony/property-info: 7.4.*
- symfony/runtime: 7.4.*
- symfony/security-bundle: 7.4.*
- symfony/serializer: 7.4.*
- symfony/stimulus-bundle: ^3.0
- symfony/string: 7.4.*
- symfony/translation: 7.4.*
- symfony/twig-bundle: 7.4.*
- symfony/ux-turbo: ^3.0
- symfony/validator: 7.4.*
- symfony/web-link: 7.4.*
- symfony/yaml: 7.4.*
- symfonycasts/reset-password-bundle: ^1.25
- symfonycasts/tailwind-bundle: ^0.12.0
- symfonycasts/verify-email-bundle: ^1.18
- twig/extra-bundle: ^2.12|^3.0
- twig/twig: ^2.12|^3.0
Requires (Dev)
- phpunit/phpunit: ^13.1
- symfony/browser-kit: 7.4.*
- symfony/css-selector: 7.4.*
- symfony/debug-bundle: 7.4.*
- symfony/maker-bundle: ^1.0
- symfony/stopwatch: 7.4.*
- symfony/web-profiler-bundle: 7.4.*
Conflicts
README
Symfony bundle with full authentication, admin panel, reCAPTCHA v3, profile management, and legal pages — ready to install in any Symfony 7.4+ project.
What the bundle provides
- Authentication — form login, logout, CSRF protection
- User registration — with email verification (SymfonyCasts VerifyEmail)
- Password reset — full email-based flow (SymfonyCasts ResetPassword)
- Profile — edit name/email and change password
- Admin panel — EasyAdmin 5 with user CRUD
- reCAPTCHA v3 — protection on login, registration, and password reset
- Legal pages — privacy policy and terms of use
- CLI command —
app:create-userto create users from the terminal - Pre-configured security — firewall, provider, and access_control injected automatically via
prependExtension
Requirements
- PHP 8.2+
- Symfony 7.4
- PostgreSQL (or any other Doctrine-supported database)
- Mailer configured (for sending verification and password reset emails)
Installation
Automatic installation (Symfony Flex recipe)
If you have added the custom recipe endpoint to your project's composer.json (see Flex Recipe below), all configuration is applied automatically:
composer require tdmsistemasweb/core-bundle
Flex will automatically:
- Register the bundle in
config/bundles.php - Create
config/packages/reset_password.yaml - Create
config/routes/tdmsistemasweb_core.yaml - Add environment variables to
.env
Then just run the migrations:
php bin/console doctrine:migrations:migrate
Manual installation
If you are not using the Flex recipe, follow the steps below.
1. Install via Composer
composer require tdmsistemasweb/core-bundle
2. Register the bundle
In config/bundles.php:
return [ // ... other bundles TdmSistemasWeb\CoreBundle\TdmSistemasWebCoreBundle::class => ['all' => true], ];
3. Import the routes
In config/routes.yaml:
tdmsistemasweb_core: resource: '@TdmSistemasWebCoreBundle/config/bundle_routes.yaml'
4. Configure the password reset repository
Create (or edit) config/packages/reset_password.yaml:
symfonycasts_reset_password: request_password_repository: TdmSistemasWeb\CoreBundle\Repository\ResetPasswordRequestRepository
5. Configure Doctrine entity mapping
In config/packages/doctrine.yaml, add the bundle's entity mapping inside orm.mappings:
doctrine: orm: mappings: TdmSistemasWebCoreBundle: type: attribute is_bundle: false dir: '%kernel.project_dir%/vendor/tdmsistemasweb/core-bundle/src/Entity' prefix: 'TdmSistemasWeb\CoreBundle\Entity' alias: TdmSistemasWebCoreBundle
Note: the bundle injects this mapping automatically via
prependExtension. If you prefer not to rely on prepend, add it manually as shown above.
6. Register the bundle migrations
In config/packages/doctrine_migrations.yaml:
doctrine_migrations: migrations_paths: 'TdmSistemasWeb\CoreBundle\Migrations': '%kernel.project_dir%/vendor/tdmsistemasweb/core-bundle/migrations'
7. Run the migrations
php bin/console doctrine:migrations:migrate
8. Configure environment variables
Add to your .env (or .env.local):
# Mailer — configure a real transport in production MAILER_DSN=null://null # Enable/disable public user registration via the web form REGISTRATION_ENABLED=true # reCAPTCHA v3 — get your keys at https://www.google.com/recaptcha/admin RECAPTCHA_SITE_KEY= RECAPTCHA_SECRET_KEY= # Google Analytics 4 (optional, only used in production) GOOGLE_ANALYTICS_ID=
Leave
RECAPTCHA_SITE_KEYandRECAPTCHA_SECRET_KEYempty to disable reCAPTCHA validation in development.
Security
The bundle automatically configures the following via prependExtension:
- Provider
app_user_provider— loads users by email fromTdmSistemasWeb\CoreBundle\Entity\User - Firewall
main— form_login pointing toapp_login, logout atapp_logout - Access control — public routes (login, registration, reset, legal pages) and admin protected by
ROLE_ADMIN
If you need to override any part of the security configuration, create config/packages/security.yaml in your project. Note: access_control is not mergeable — defining your own replaces the bundle's entirely.
Available routes
| Name | Method | Path |
|---|---|---|
app_home |
GET | / |
app_login |
GET/POST | /login |
app_logout |
GET | /logout |
app_register |
GET/POST | /register |
app_verify_email |
GET | /verify/email |
app_forgot_password_request |
GET/POST | /reset-password |
app_check_email |
GET | /reset-password/check-email |
app_reset_password |
GET/POST | /reset-password/reset/{token} |
app_profile |
GET/POST | /profile |
app_profile_password |
POST | /profile/password |
app_privacy_policy |
GET | /politica-de-privacidade |
app_terms_of_use |
GET | /termos-de-uso |
admin |
ANY | /admin |
Create a user via CLI
php bin/console app:create-user --name="John Doe" --email="john@example.com" --password="secret123" # To create an admin user php bin/console app:create-user --name="Admin" --email="admin@example.com" --password="secret123" --admin
Customising templates
The bundle's templates can be overridden by creating files at the same path inside your project's templates/ directory:
templates/
├── base.html.twig ← main layout
├── home/index.html.twig
├── security/login.html.twig
├── registration/register.html.twig
├── reset_password/request.html.twig
├── profile/edit.html.twig
└── legal/
├── privacy_policy.html.twig
└── terms_of_use.html.twig
Local development (Docker)
The repository includes a full Docker environment for developing the bundle itself.
# Start all services docker compose up -d # Run migrations docker compose exec php php bin/console doctrine:migrations:migrate # Create an admin user docker compose exec php php bin/console app:create-user --admin # Access the application open http://localhost:8080 # Mailpit (dev emails) open http://localhost:8025
Flex Recipe
The recipe files live in the recipe/ directory of this repository, ready to be published to a dedicated tdmsistemasweb/recipes GitHub repository.
Publishing the recipe
- Create a new GitHub repository:
tdmsistemasweb/recipes - Copy the contents of the
recipe/directory to the root of that repository and push - The repository structure should look like this:
index.json
tdmsistemasweb/
core-bundle/
1.0/
manifest.json
.env
config/
packages/
reset_password.yaml
routes/
tdmsistemasweb_core.yaml
Using the recipe in a project
Add the custom endpoint to the project's composer.json before installing the bundle:
{
"extra": {
"symfony": {
"endpoint": [
"https://api.github.com/repos/tdmsistemasweb/recipes/contents/index.json",
"flex://defaults"
]
}
}
}
Then install the bundle normally — Flex will apply the recipe automatically:
composer require tdmsistemasweb/core-bundle
What the recipe does
| Action | Detail |
|---|---|
| Registers the bundle | Adds TdmSistemasWebCoreBundle to config/bundles.php |
| Config: reset password | Creates config/packages/reset_password.yaml |
| Config: routes | Creates config/routes/tdmsistemasweb_core.yaml |
| Env vars | Appends REGISTRATION_ENABLED, RECAPTCHA_SITE_KEY, RECAPTCHA_SECRET_KEY, GOOGLE_ANALYTICS_ID to .env |
Everything else (Doctrine entity mapping, migrations path, security firewall) is configured automatically by the bundle's prependExtension — no recipe files needed for those.
License
MIT