Skip to content

alen125/home-budget-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Budget App

A clean and modular Symfony 7.3 application built with a modern Dockerized stack — featuring a secure JWT authentication system, PostgreSQL database, REST API with OpenAPI/Redoc documentation, and full PHPUnit test coverage.


Tech Stack

Component Description
Symfony 7.3 Backend framework (PHP 8.3)
PostgreSQL Primary database
Nginx Web server and reverse proxy
PHP-FPM 8.3 Runtime for the Symfony application
LexikJWTAuthenticationBundle JWT-based authentication
Redocly / OpenAPI API documentation (redocly/redoc container)
PHPUnit Unit & functional web tests
PHPStan Static analysis for code quality
Docker Compose Container orchestration and environment setup

Quick Start

1. Clone the repository

git clone https://github.com/yourusername/home-budget-app.git
cd home-budget-app

2. Build and start the containers

make app.up

This command will:

  • Build all Docker containers
  • Start the full stack (nginx, php, postgres, redoc)
  • Automatically run database migrations to prepare the schema

Once complete:


3. Run tests

To load fixtures and run the PHPUnit test suite:

make app.tests

This will:

  • Load demo fixtures into the database
  • Execute the full web test suite using bin/phpunit

4. Connect to the PHP container

If you need to run Symfony or Composer commands manually:

make app.connect

This will open an interactive shell inside the PHP container.


Common Make Commands

Command Description
make app.build Build Docker images
make app.up Start all containers (with build & migrations)
make app.down Stop and remove containers
make app.restart Restart the full stack
make app.connect Open a shell inside the PHP container
make app.logs Follow container logs
make app.run_migrations Run Doctrine migrations
make app.run_fixtures Load database fixtures
make app.tests Load fixtures & run PHPUnit tests

Authentication

Authentication is handled via JWT tokens generated using the LexikJWTAuthenticationBundle.

  • Login: POST /api/login
    Returns a JWT token for authorized requests.

Protected endpoints require this header:

Authorization: Bearer <your-token>

API Documentation

API endpoints are documented using OpenAPI 3.1 and served through Redocly.

Once containers are up, visit:

http://localhost:2100

You’ll find a categorized, interactive documentation view (Authentication, Budget, Expenses, Expense Categories).


Quality & Testing

  • Static analysis: PHPStan ensures code safety and cleanliness.
  • Feature & web tests: PHPUnit simulates real HTTP requests to test endpoints and business logic.
  • Fixtures: Doctrine fixtures provide repeatable test data.

Useful Notes

  • Database migrations and fixtures are idempotent — feel free to rebuild anytime using:
    make app.run_migrations
    make app.run_fixtures
  • To rebuild everything from scratch:
    make app.down
    make app.up

About

This project was built as a technical demonstration of clean backend architecture and DevOps practices:

  • Proper Dockerized Symfony setup
  • CI-friendly Makefile automation
  • JWT-secured REST API with pagination, sorting, filtering, and validation
  • Full OpenAPI documentation and testing discipline

Enjoy exploring the code

If you have Docker and Make installed, you can get the entire stack running in under 2 minutes.

About

Home Budget app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages