Skip to content

FreddyIW/php-rest-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 50.6%
  • TypeScript 33.2%
  • CSS 7.0%
  • JavaScript 3.7%
  • HTML 3.3%
  • Dockerfile 2.2%