Skip to content

tamuhack-org/Ouroboros

Repository files navigation

codecov

🐍 Hiss

An open-source, hackathon registration system. 🏫

❓ Questions

If you have questions, we might've answered them already on the wiki! Check it out.

💻 Running Locally

Local Development

For local development, we highly encourage using Docker Compose.

After Docker Compose is installed, there are just a few steps left for first-time setup:

docker-compose up -d
docker-compose exec db su postgres # Currently on host, moving into container
psql # Currently in container, moving into PostgreSQL prompt 

Now that you're in the PostgreSQL prompt, just run

CREATE DATABASE hiss;

This will create the database for you, and you're done with setup!

exit # In the PostgreSQL prompt, moving to container
exit # In the container, moving to the host

Now that you're on the host machine, just run the following:

docker-compose run web python3 manage.py makemigrations # Only if you modified models.py or forms.py
docker-compose run web python3 manage.py migrate --run-syncdb
docker-compose exec web python3 manage.py loaddata application/fixtures/schools.json # Loads in schools for school dropdown in application
docker-compose run web python3 manage.py createsuperuser # Enter details for an admin user to access the admin panel.

You're all set! Just run docker-compose up and you're good to go!

Mimic Production

To mimic a real production environment, a docker-compose.prod.yml file has been included in the repository for you to use.

This file is set up on the assumption that you are using Mailgun as your team's email provider.

To use it, simply replace the values in docker-compose.prod.yml with the values you need, and run

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

Staging Environment

We also have a staging environment Github Action workflow. To run this, simply create another heroku app, set HEROKU_APP_NAME in .github/workflows/staging.yml to the name of the heroku app, and push to a non-protected branch.

In order for the staging environment to work, you must connect a Heroku Postgres instance to the app. Anytime you change models or forms and make a new migration, you must manually sync the database in the heroku console.

To do this, push to the staging environment, open the Heroku bash shell, and run the following command:

python3 manage.py migrate --run-syncdb

Contributing

Install Poetry. Once installed, navigate to the root of the project and run the following:

poetry install
poetry run autohooks activate

This enables pre-commit hooks to make sure your code is formatted prooperly, so you won't get blocked in a PR.

Brought to you by

TAMUhack