Simple dependency-free REST API using native PHP 8.2 features and PDO for PostgreSQL.
🚀 Easiest Way (Recommended):
# One command to start everything
./scripts/start-server.shThen open:
- http://localhost:8000/gantt - Gantt Chart view
- http://localhost:8000/todos - List View
See SERVER_QUICK_START.md for details.
📋 Manual Setup:
- Copy environment file (optional - uses defaults if not present)
cp .env.example .env
# Edit .env to customize database credentials if needed- Start PostgreSQL (Docker)
docker compose up -d db- Install Composer autoload (optional but recommended)
composer install- Run database migrations
composer migrate- Start the development server
composer serve
# OR use the smart script:
./scripts/start-server.shVisit http://localhost:8000/health, http://localhost:8000/gantt, or http://localhost:8000/todos.
- GET
/health– service health - GET
/gantt– Gantt chart view (HTML) - GET
/todos– list todos (JSON) or List view (HTML) - GET
/todos/{id}– get todo - POST
/todos– create todo{ "title": "Task", "completed": false } - PUT
/todos/{id}– update fields{ "title": "New", "completed": true } - DELETE
/todos/{id}– delete todo
See docs/API.md for examples.
The application uses environment variables for configuration. Create a .env file in the project root:
cp .env.example .env| Variable | Description | Example Value |
|---|---|---|
DB_HOST |
Database host | db |
DB_PORT |
Database port | 5432 |
DB_NAME |
Database name | app |
DB_USER |
Database user | app |
DB_PASSWORD |
Database password | app |
APP_ENV |
Application environment | local / testing / production |
PORT |
Server port | 8000 |
DB_READY_TIMEOUT |
Database ready timeout (seconds) | 30 |
TEST_SERVER_PORT |
Test server port | 8001 |
Quick test (CI/CD mode - recommended):
./scripts/run-tests.sh --skip-integrationUsing Make:
make test # Run unit tests
make test-coverage # With coverage report
make ci # Full CI/CD pipelineManual:
# Unit tests only (62 tests, 100% pass rate)
docker compose run --rm php vendor/bin/phpunit --testsuite Unit
# Gantt drag logic tests (19 tests)
docker compose run --rm php vendor/bin/phpunit tests/Unit/GanttDragLogicTest.php --testdox
# Gantt chart integration tests (10 tests)
docker compose run --rm php vendor/bin/phpunit tests/Integration/GanttChartTest.php --testdoxTest script features:
- ✅ Automatic setup and cleanup
- ✅ Database health checks
- ✅ Dependency management
- ✅ Colored output
- ✅ CI/CD ready
See docs/TESTING.md and docs/CI_CD.md for detailed documentation.
Smart server script with duplicate prevention:
./scripts/start-server.sh # Start server (checks if already running)
./scripts/start-server.sh --status # Check status
./scripts/start-server.sh --stop # Stop server
./scripts/start-server.sh --restart # Force restartSee docs/SERVER_MANAGEMENT.md for complete guide.
📚 Complete Documentation Index: See DOCS_INDEX.md for all docs
Quick Links:
- 🧪 Testing Guide - 108+ tests, all suites
- 🚀 CI/CD Guide - GitHub Actions, GitLab CI
- 📊 API Reference - All endpoints with examples
- 🎯 Gantt Features - Interactive Gantt chart
- 🏗️ Technical Overview - Architecture