This is the source code for IFDB, the Interactive Fiction Database.
As of Jan 22, 2021, the code in this repository hasn't been deployed yet. We're going to work together to make this code ready to deploy at a new domain name.
The IFDB web app is a LAMP app (Linux, Apache, MySQL, PHP). The development environment runs on Docker.
-
Install Docker and Docker Compose. https://docs.docker.com/get-docker/
-
Run
./prepare_dev_environment.shin this directory. That will download the current latest IFDB database backup from IFArchive, and put it in a place where Docker will expect to find it. -
Run
docker-compose up. That will launch a MySQL Docker container and an Apache container with PHP, available on port 8080. -
Go to
http://localhost:8080on your machine. You should see IFDB running. You can login asifdbadminatifdb.orgwith the passwordsecretto sign in as an administrator. The administrator has access to the "system maintenance panel" athttp://localhost:8080/adminops -
Optionally, you can query the database using phpMyAdmin at
http://localhost:8081or rundocker exec -it ifdb_db_1 mysql -psecret ifdbto use the MySQL command-line interface.
- Sending email doesn't work. That's unfortunate, because if you want to create a user, you'll need to login with an activation code. After you try to create a new user, you should be able to see the email text in the Docker logs. Search for
EMAIL: NOT SENDING EMAIL IN LOCAL DEVELOPMENT MODE. - Game box-art images load from the production IFDB site, not the dev environment. IFDB uses a separate "images" database that isn't part of the IFArchive backup. We'll need to generate a backup of that database and make it available on IFArchive, or, at the very least, provide a way for developers to download images from the real IFDB.
To reset the Docker environment, stop docker-compose with Ctrl-C, then run docker-compose down to delete the images. If you're modifying the Dockerfile, you might also need to docker rmi ifdb_web to clean out state.
If you see a 500 error loading http://localhost:8080, check the Docker logs. If you see one of these errors, then something went wrong during the ./prepare_dev_environment.sh step.
PHP Warning: include_once(local-credentials.php): failed to open stream: No such file or directoryPHP Warning: include_once(): Failed opening 'local-credentials.php' for inclusionPHP Fatal error: Uncaught Error: Call to undefined function localCredentials()
If you see this, reset the Docker environment (see above), then run ./prepare_dev_environment.sh and docker-compose up again.