An experimental/prototype/demonstration CRUD system to try to get a friend started.
Unless you're Owen, it's probably not suitable for you.
Even if you ARE Owen, it might not be.
Tread carefully.
- Install Docker Desktop and make sure it's running.
- Clone this repository (download a copy of it!).
- In a command prompt/terminal, navigate to the directory you checked out.
- Run
docker compose up
- See the application at http://localhost:8080/ (its source code is in
src/
) - Browse/edit the database at https://localhost:8081/ (the database is called "mydatabase")
- Press
CTRL-C
in the command prompt/terminal to kill the application when you're done. The contents of the database and your code won't be affected (they'll still be there when you rundocker compose up
next time!)
- Docker is your virtualisation platform. It makes it easy to simulate running a server on your computer. It's configured in
compose.yml
to provide:- a PHP-capable web server running on
localhost:8080
(further configured inDockerfile
), - PHPMyAdmin, a convenient web-based front end for managing your database, running on
locahost:8081
, and - a database server to which both connect
- a PHP-capable web server running on
- The database stores its files in
db/storage
, but they're not really designed for you to read! You can deletedb/storage
and then restart your Docker containers to wipe the database though. - When starting from scratch, the database container runs the scripts in
db/initial
: I've put a script that creates a "fruits" table and puts some sample data in it- You can design/edit tables in PHPMyAdmin and then use the "Export" tool to turn them into .sql files (to put in the
db/initial
folder) for next time you start from scratch.
- You can design/edit tables in PHPMyAdmin and then use the "Export" tool to turn them into .sql files (to put in the
- The code in
src/
is made available via your webserver.index.php
is the "root" page you sdee at http://localhost:8080/. I'm sure you can work out what the other pages do by trial and error!src/
is where you'll do most of your work!