Skip to content

Both REST API for http connections and PHP librairy. Manage Interactions between client applications and database. (Mirror of GitLab repo)

Notifications You must be signed in to change notification settings

nowtryz/cafet-app

Repository files navigation

Cafet Manager - PHP API Server : Beta 0.2.0

Both REST API for http connections and PHP librairy. Manage Interactions between client/server-side applications and database

Rest API

Documentation about the rest api can found here or in the openapi specifications file

Stand-alone installation

Docker

  1. Make sure to have docker and docker-compose install on your server
  2. To run the server in a docker container, just create a docker-compose.yml with the content bellow
    version: "3"
    services:
        php:
            image: registry.gitlab.com/cafet-app/cafet-app/server:latest
            container_name: cafet-server
            environment:
                SERVER_DOMAIN: localhost
                MAILHUB: localhost
            ports:
                - "80:80"
            links:
                - db
            depends_on:
                - db
            volumes:
                - php-logs:/var/log
            networks:
                - cafet_net
    
        db:
            image: registry.gitlab.com/cafet-app/cafet-app/database:latest
            container_name: cafet-server-mysql
            restart: always
            ports:
                - '3306:3306'
            networks:
                - cafet_net
    
    volumes:
        php-logs:
    
    networks:
        cafet_net:
  3. Then start docker-compose
    echo DGNvKHoDSYNLxxbZe2cr | docker login -u docker-token --password-stdin registry.gitlab.com
    docker-compose up -d

Binary Install

Requierments

  • Apache
    • Tested with Apache 2.4.33
    • Extension mod_rewrite enabled
  • PHP 7.2 or upper with PDO, tested with:
    • Tested versions:
      • PHP 7.2.4
      • PHP 7.2.9
    • Extensions:
      • PDO
    • PDO_mysql
  • MySQL 5.7 or upper
    • tested with MySQL 5.7.21

Installation

  1. Dowload the latest version and unpack the app folder where you want.
  2. Create a virtual host pointing to this folder. e.g. cofee.example.com
  3. Create a database.
  4. Run SQL import scripts that you can find here on your mysql server.
  5. Open and edit path/to/app/cafetapi_content/config.php.
  6. Access http://cofee.example.com and your installation is now up and ready

Development environment installation

Source code

Clone the git repository

git clone [email protected]:cafet-app/php-api-server.git
cd php-api-server

Run development environment

docker-compose up --build

Access app

Without any other docker port binding:

  • The app is accessible from {docker_host}:80/
  • phpMyAdmin is accessible from {docker_host}:81/

Loging in app

Demo user is Nowtryz <[email protected]> with password admin. Easy to keep in mind 😉, let's enjoy!

Future updates

  • Work with composer
  • Create docker images
  • Implementation of gettext

About

Both REST API for http connections and PHP librairy. Manage Interactions between client applications and database. (Mirror of GitLab repo)

Resources

Stars

Watchers

Forks

Packages