How nbcomrade/get-jobs works
1. This is a Symfony 3.4-style monolith with a classic front-controller layout. HTTP traffic enters through web/app.php or web/app_dev.php, boots app/AppKernel.php, loads environment-specific config from app/config, and routes requests via Symfony routing.
2. The main application code lives in src/AppBundle. The app is organized as a standard Symfony bundle, with one primary controller (DefaultController) handling the user-facing flows and delegating work to services, forms, and repositories rather than embedding business logic in the controller.
3. The domain/persistence layer is centered on Doctrine entities: FeaturedJob and SearchSetting. These represent the app’s stored state, while custom Doctrine repositories (FeaturedJobRepository, SearchSettingRepository) encapsulate database queries.
4. There is a clear separation between persisted entities and transport objects. DTO/Job.php and DTO/JobQuery.php suggest the app handles job data and job-search criteria as in-memory transfer objects before mapping them to entities or queries.
5. Application services are abstracted behind interfaces in Contract/: ParserInterface and SenderInterface. The concrete implementations in Service/Parser.php and Service/Sender.php likely perform the core business actions: parsing job data from an external source and sending notifications or messages.
6. The presence of Form/ParseType.php and Form/SettingType.php indicates the UI is form-driven. These form types bind user input to the app’s DTOs or entities and are the main boundary between HTTP requests and the application layer.
7. Presentation is server-rendered with Twig. Templates under app/Resources/views define the base layout and the default pages (index, show, configure), so the app is primarily an HTML-rendered Symfony app rather than a client-side SPA.
8. Data flow is likely: user request → controller → form/DTO validation → service/repository calls → Doctrine persistence or external parsing/sending → Twig render. The controller appears to orchestrate these steps, while the services and repositories keep the business and data access concerns isolated.
9. Database schema changes are managed with Doctrine migrations in app/DoctrineMigrations. That means schema evolution is versioned and deployed separately from runtime code.
10. The app uses Symfony’s standard support stack from the README: Twig for templating, Doctrine ORM/DBAL for persistence, SecurityBundle for auth/security configuration, and Swiftmailer support via Symfony’s mail integration. The Sender service is the most likely integration point for outgoing email.
11. Front-end assets are kept under web/assets with webpack.config.js and SCSS/JS entry points. This suggests a small compiled asset pipeline for styles and scripts, served from the Symfony web root rather than a separate frontend app.
12. Environment and operational boundaries are conventional Symfony: config_dev.yml, config_prod.yml, and config_test.yml split runtime behavior; var/cache, var/logs, and var/sessions hold runtime state; and tests/AppBundle/Controller/DefaultControllerTest.php covers controller behavior at the HTTP layer.
13. For an architecture diagram, the key boxes are: Symfony kernel/bootstrap, controller layer, form/DTO layer, service interfaces and implementations, Doctrine repositories/entities, Twig views, and the database/external sending/parsing integration points. The most important arrows are request handling into the controller, controller delegation into parser/sender/repositories, and persistence/output back to the browser.
Main entry points: DefaultController.php Default controller · Parser.php Parser · AppKernel.php Kernel · Sender.php Sender
Components 24
Bootstrap
Symfony front controller, kernel, config, and runtime boundaries.
- Front controller · HTTP entry point for the production environment.
web/app.php - Dev front controller · HTTP entry point with development tooling enabled.
web/app_dev.php - Kernel · Bootstraps bundles and framework services.
app/AppKernel.php - Routing · Defines the application routes and environment-specific routing.
app/config/routing.yml - App config · Main service and framework configuration.
app/config/config.yml - Service wiring · Service definitions and dependency wiring.
app/config/services.yml
App Bundle
Primary application code for HTTP, forms, services, domain, and persistence.
- Default controller · Orchestrates request handling and delegates to forms, services, and repositories.
src/AppBundle/Controller/DefaultController.php - Parse form · Binds parse requests to application input.
src/AppBundle/Form/ParseType.php - Setting form · Binds configuration input to persisted settings.
src/AppBundle/Form/SettingType.php - Job DTO · In-memory job representation used between layers.
src/AppBundle/DTO/Job.php - Query DTO · Search criteria object for job lookup and parsing.
src/AppBundle/DTO/JobQuery.php - Parser API · Interface for parsing jobs from an external source.
src/AppBundle/Contract/ParserInterface.php - Sender API · Interface for sending notifications or messages.
src/AppBundle/Contract/SenderInterface.php - Parser · Concrete parser service behind the parser contract.
src/AppBundle/Service/Parser.php - Sender · Concrete sending service behind the sender contract.
src/AppBundle/Service/Sender.php - Featured job · Persisted featured job record.
src/AppBundle/Entity/FeaturedJob.php - Search setting · Persisted search configuration record.
src/AppBundle/Entity/SearchSetting.php - Featured repo · Database access for featured jobs.
src/AppBundle/Repository/FeaturedJobRepository.php - Settings repo · Database access for search settings.
src/AppBundle/Repository/SearchSettingRepository.php
Presentation
Server-rendered Twig templates and public assets.
- Base layout · Shared HTML shell for rendered pages.
app/Resources/views/base.html.twig - Pages · Primary server-rendered pages for index, show, and configure flows.
app/Resources/views/default/index.html.twig - Assets · Compiled CSS/JS and static assets served from the web root.
web/assets/js/index.js
Operations
Database migrations, tests, and environment/runtime support.
- Migrations · Versioned database schema evolution.
app/DoctrineMigrations/Version20180316084207.php - Controller test · Exercises the main controller at the HTTP layer.
tests/AppBundle/Controller/DefaultControllerTest.php
Connections 29
- Front controller → Kernel: boots · Production front controller starts the Symfony kernel.
- Dev front controller → Kernel: boots · Development front controller starts the Symfony kernel.
- Kernel → Routing: loads · Kernel uses routing configuration to resolve requests.
- Kernel → App config: loads · Kernel loads framework and app configuration.
- App config → Service wiring: wires · Configuration defines services and dependency injection.
- Routing → Default controller: dispatches · Routes map incoming requests to the default controller.
- Default controller → Parse form: uses · Controller binds parse flows through the parse form.
- Default controller → Setting form: uses · Controller binds configuration flows through the setting form.
- Default controller → Parser API: depends on · Controller delegates parsing to the parser abstraction.
- Default controller → Sender API: depends on · Controller delegates sending to the sender abstraction.
- Default controller → Featured repo: queries · Controller reads featured jobs through the repository.
- Default controller → Settings repo: queries · Controller reads and updates search settings through the repository.
- Default controller → Base layout: renders · Controller renders pages through the shared layout.
- Default controller → Pages: renders · Controller renders the main server-side pages.
- Parse form → Query DTO: binds · Parse form binds user input to query data.
- Setting form → Search setting: binds · Setting form binds user input to persisted settings.
- Parser → Parser API: implements · Concrete parser fulfills the parser interface.
- Sender → Sender API: implements · Concrete sender fulfills the sender interface.
- Parser → Job DTO: produces · Parser creates in-memory job representations.
- Parser → Query DTO: consumes · Parser uses search criteria to drive parsing.
- Sender → Featured job: updates · Sender may persist or use featured job state when notifying.
- Featured repo → Featured job: stores · Repository manages featured job persistence.
- Settings repo → Search setting: stores · Repository manages search setting persistence.
- Pages → Assets: includes · Pages rely on the compiled front-end assets.
- Migrations → Featured job: evolves · Migrations evolve the schema backing domain entities.
- Migrations → Search setting: evolves · Migrations evolve the schema backing domain entities.
- Controller test → Default controller: covers · HTTP test exercises the main controller flow.
- Default controller → Parser: uses · Controller invokes the parser service implementation via its contract.
- Default controller → Sender: uses · Controller invokes the sender service implementation via its contract.