A full-stack CRUD application for managing customer records, built for a technical assessment project. It allows creating, viewing, updating, and deleting customer records, with fast full-text search powered by Elasticsearch.
The backend is containerized with Docker Compose and consists of 4 services:
- api β Laravel backend handling all business logic and CRUD operations
- controller β Nginx, acting as the load balancer in front of the API
- database β PostgreSQL, the primary data store for customer records
- searcher β Elasticsearch, a searchable mirror of customer data kept in sync automatically whenever a record is created, updated, or deleted
Whenever a customer record changes in PostgreSQL, an Eloquent model observer automatically pushes that change to Elasticsearch via Laravel's built-in HTTP client β no third-party sync package (e.g. Laravel Scout) is used.
The React frontend runs separately from Docker and talks to the backend over HTTP.
Before starting, make sure you have the following installed:
- Docker Desktop (includes Docker Compose, because that's more convenient)
- Node.js (v18 or later recommended) and npm (I personally used pnpm), for running Vite + React
PHP, Composer, and Postgres all run inside Docker.
git clone <this-repository-url>
cd tech-crudCopy the example environment file for the backend:
cp api/.env.example api/.envThe Docker Compose file already injects the correct database and Elasticsearch connection values (host, port, credentials) into the api container at runtime, so the defaults in api/.env for those specific keys will be overridden automatically β no manual editing required to get the app running locally.
From the project root (where docker-compose.yml lives):
docker compose up -d --buildThis builds the api image and starts all four services: api, controller, database, and searcher.
Check that everything is running:
docker compose psAll four containers should show as Up.
docker compose exec api php artisan migrateThis creates the customers table in PostgreSQL.
(Optional) Seed some sample data for manual testing:
docker compose exec api php artisan tinkerApp\Models\Customer::factory()->count(10)->create();- Visit http://localhost:8080 in your browser β you should see Laravel's default response, confirming Nginx, PHP-FPM, and Laravel are wired up correctly.
- Test the API directly:
curl http://localhost:8080/api/customers
- Verify Elasticsearch is reachable:
curl http://localhost:9200
docker compose exec api php artisan testThis runs the full PHPUnit feature test suite against an isolated in-memory SQLite database, covering all CRUD endpoints and validation rules.
The frontend is not containerized and runs directly on your machine, separately from Docker.
cd frontend
npm install
npm run devBy default, the frontend expects the API to be reachable at http://localhost:8080/api (the address exposed by the controller service above). If your setup uses a different port, update the API base URL in the frontend's API client configuration accordingly.
Once running, open the local dev server URL shown in your terminal (typically http://localhost:5173) to use the app.
docker compose downAdd -v if you also want to remove the Postgres and Elasticsearch data volumes and start completely fresh next time:
docker compose down -v.
βββ api/ # Laravel backend
βββ frontend/ # React frontend (run separately, not containerized)
βββ docker/
β βββ nginx/
β βββ default.conf # Nginx config for the controller service
βββ docker-compose.yml
βββ README.md