- Put all backend APIs in
./apis - YOU MUST PUT
require("./utils.php");BEFORE ANYTHING IN EVERY PHP CODES. - The frontend is built with Vue2, all the codes are in
./sql-fe - DO NOT EDIT
Dockerfile,./docker-compose/*UNLESS YOU KNOW WHAT YOU ARE DOING - You can edit
docker-compose.ymlto change the app's port which in line 22, the default is 8022.
- npm 15.3 or later
- Vue cli 4.5.8 or later
- docker and docker-compose (Optional, only if you do not want a web server)
- XAMPP (Optional, only if you do not want docker)
A web server like 200OK, python's http.server or even better Nginx (Optional, only if you do not want docker)
- Clone this repository
git clone https://github.com/FalconLee1011/SQL-EOT
- Build the frontend
cd ./SQL-EOT/sql-fenpm installnpm run build
- Docker build and run
cd ..sudo docker-compose build appsudo docker-compose up -d- Use
sudo docker psto confirm that you have following containers running.- jacnginx
- just-a-container-app
- Example of output for
sudo docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES aaaaaaaaaaaa nginx:alpine "/docker-entrypoint.…" 9 minutes ago Up 2 minutes 0.0.0.0:8022->80/tcp jacnginx bbbbbbbbbbbb just-a-container "docker-php-entrypoi…" 9 minutes ago Up 2 minutes 9000/tcp just-a-container-app cccccccccccc mariadb "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:8306->3306/tcp jacFxxkMaria
- Configure SQL Connection
- Use
docker inspect jacFxxkMaria | grep IPto get mariaDB's docker IP cd ./apiscp ./db_conn.php.example db_conn.php- Configure following variables
- user
- password
- host
- port
- Use
- Testing
- Visit the app from your browser @
http://localhost:8022/ - Call the app' APIs from your browser @
http://localhost:8022/api/<api_file>
- Visit the app from your browser @
- Combine XAMPP is possible but untested.
- The original way to deploy without docker is not possible due to the need of mariaDB's docker image and php's dependency.
Clone this repositorygit clone https://github.com/FalconLee1011/SQL-EOT
Build the frontendcd ./SQL-EOT/sql-fenpm installnpm run build
- S
tart the php web server at repository rootcd ..php -S localhost:8080python3 -m http.server(if you use python's http.server module)
TestingVisit the app from your browser @http://localhost:8080/sql-feCall the app' APIs from your browser @http://localhost:8080/api/<api_file>
- This app has been tested on Manjaro 20.2 and it work like a charm.