Skip to content

A potential future replacement for imdt: the archive of past shows put on by DramaTech Theatre in Atlanta, GA

License

Notifications You must be signed in to change notification settings

davidhollis/dtdb

Repository files navigation

dtdb

A potential future replacement for imdt: the archive of past shows put on by DramaTech Theatre in Atlanta, GA

Development

Reference Material

The backend for this site is written primarily in rust. It uses:

Environment Setup

The most direct way to get set up is to ensure you have docker installed and run

docker compose up

This will start containers for the database and the application server, initialialize and migrate the database, and start the application server on port 64741. It will also watch the current directory, and will rebuild and restart the application server on almost any change2 to the application.

I want to set this up without using containers

First, get postgres running and accessible from your development environment in whatever manner works best for you. Note the connection details, then

echo "DATABASE_URL=postgres://user:pass@localhost:5432/dtdb_dev" >.env

where the credentials, host, and port are appropriate for your setup. The database name dtdb_dev is recommended, but you can name the database whatever you want. If it doesn't exist yet, it'll be created later as long as the user has permission to create a database.

Next, make sure you have rust installed, then run the following to migrate the DB:

# Install the CLI for the database abstraction library
cargo install diesel_cli --no-default-features --features postgres

# Create the database if it doesn't exist and run all the migrations
diesel setup

Finally, make sure everything's working:

cargo build
cargo test

Now, to launch the application server, you can run

cargo run -- --config config.json

Footnotes

  1. chosen because it doesn't belong to any other popular application and "\x64\x74" is "dt"

  2. It may miss changes that only impact views, static files, or migrations. If you notice that happening, docker compose restart website should force a reload.

About

A potential future replacement for imdt: the archive of past shows put on by DramaTech Theatre in Atlanta, GA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published