Skip to content

Taardal/php-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PHP REST API

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.

Components

Prerequisites ๐Ÿšฆ

Getting started ๐Ÿƒ

Getting the code :octocat:

  • Clone the repository: git clone https://github.com/taardal/php-rest-api

Running the app ๐Ÿš€

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

Docker ๐Ÿณ

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

About

Sample REST API written in PHP with a MySQL database and Docker

Topics

Resources

Stars

Watchers

Forks