This is a balance transfer application with a Symfony 5 JSON API backend and a Vue.js 3 frontend.
- Backend: Symfony 5.3 / PHP 8.0 — serves API endpoints at
/api/* - Frontend: Vue 3 + Vite + Tailwind CSS — single-page application served as static files
- Database: MySQL 8.0
- Web server: Nginx serves the Vue app at
/and proxies/apirequests to PHP-FPM
All services run in Docker. Port 8000 is the only port exposed.
You only need Docker Desktop installed.
-
Clone the git repository to your local machine.
-
Start the application:
Windows:
start.batLinux / Mac:
chmod +x start.sh ./start.sh
This builds and starts in prod mode by default (OPcache enabled, Xdebug off, Symfony cache warmed).
-
Open the application at
http://localhost:8000
To run with dev-friendly settings (OPcache off, Xdebug in develop mode, file changes reflect immediately):
Windows:
start.bat dev
Linux / Mac:
./start.sh devIf you prefer not to use the start scripts:
- Build the Vue frontend:
cd frontend npm install npm run build cd ..
- Start the containers:
docker compose up -d --build
- Run database migrations and load fixtures:
then
docker exec -it balance-transfer-symfony-1 /bin/bashphp bin/console doctrine:migrations:migrate --no-interaction php bin/console doctrine:fixtures:load --no-interaction
Note: If using VS Code with the Dev Containers extension, you can open this project with "Reopen in Container". The
post-create.shscript will automatically install dependencies, build the frontend, run migrations, and load fixtures.
| Setting | prod (default) | dev |
|---|---|---|
| OPcache | Enabled, no file revalidation | Disabled |
| Xdebug | Completely removed | Develop mode (nice error pages) |
| Symfony cache | Pre-warmed at startup | Built on first request |
| Performance | Fast (sub-second responses) | Slower (convenience over speed) |
The mode is controlled by the APP_ENV environment variable, which the start scripts set for you.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/customers |
List all customers |
| GET | /api/customers/{id} |
Get a single customer |
| GET | /api/transfers |
List all transfers |
| POST | /api/transfers |
Create a new transfer |
POST /api/transfers expects JSON:
{
"senderId": 1,
"recipientId": 2,
"amount": 50.00
}You can access the application database using a MySQL client:
| Parameter | Value |
|---|---|
| Hostname | 127.0.0.1 |
| Port | 13306 |
| User | symfony or root |
| Password | symfony |
| Database Name | app |
The Vue.js frontend lives in frontend/. After making changes:
Option A — Rebuild inside the container:
docker exec -it balance-transfer-symfony-1 bash -c "cd frontend && npm run build"Option B — Rebuild locally:
cd frontend
npm run buildOption C — Use Vite dev server for hot-reload (local Node.js required):
cd frontend
npm run devThis starts a dev server at http://localhost:5173 with API requests proxied to http://localhost:8000.
PHPUnit unit tests, functional tests and application tests are located in the tests/ directory.
To run the test suite, exec into the container first:
docker exec -it balance-transfer-symfony-1 /bin/bashThen follow these steps:
- Create the test database (if not already created):
php bin/console --env=test doctrine:database:create
- Run migrations in the test database:
php bin/console --env=test doctrine:migrations:migrate
- Load fixtures in the test database:
php bin/console --env=test doctrine:fixtures:load
- Run the tests:
php ./vendor/bin/phpunit tests/