This is a simple REST API written in PHP without any dependencies or frameworks.
Data is stored in a MySQL database and can be browsed using a very simple Angular webapp.
The API and database is run as a Docker container using Docker Compose.
- Clone the repository:
git clone https://github.com/taardal/php-rest-api
Backend
- Make sure Docker is running
- Navigate to the server:
cd api
- Run the Docker container:
docker-compose up
Frontend
- Navigate to the client:
cd www
- Run the Angular webapp:
npm start
The REST API is run as a Docker container using Docker Compose.
./api/docker-compose.yml
./api/docker/mysql/Dockerfile
./api/docker/php-apache/Dockerfile
MySQL
Sample data is added to the database using the bundled schema.sql
file
./api/docker/mysql/docker-entrypoint-initdb.d/schema.sql
Apache
Apache is configured using the bundled httpd.conf
file
./api/docker/php-apache/httpd.conf