Skip to content

Crossbox - App used to reservate sessions in Crossbox Palau (Django)

License

Notifications You must be signed in to change notification settings

oalfonso-o/crossbox

Repository files navigation

Crossbox - App to handle reservations of https://crossboxpalau.wodbuster.com/

⚠️ This app is no longer in production

Crossbox Palau is a Crossfit box located in Palau-solità i Plegamans, you can check some links here https://linktr.ee/crossboxpalau (web link is outdated, the new one is https://crossboxpalau.wodbuster.com/).

It started managing the booking of sessions with a Doodle but soon the business started to demand something a bit more sophisticated and this tool was written tailored for this box.

The first versions only had the basics to have users and sessions. The latest ones include payment subscriptions based on Stripe payment system. And it kept evolving to fit the new needs of the box.

The production environment of this app was at https://reservations.crossboxpalau.com/.

You can find more detailed information about this project in this page.

There are no translations, as it was only for Spanish customers. If you want to use it in other languages you have to implement the translations.

Installation

As this app has payments that are processed with Stripe we need an account before filling the environment variables.

Docker

Requirements

Notice that now compose is a plugin of docker, but this project was made when compose had a different bin, so if you use compose as a plugin of docker, change "docker-compose" with "docker compose".

Env vars

cp .env.example .env
cp crossbox/static/js/custom/.env.js.example crossbox/static/js/custom/.env.js

And edit them. The minimum are:

DJANGO_STRIPE_PUBLIC_KEY (.env)
DJANGO_STRIPE_SECRET_KEY (.env)
stripe_publishable_key (.env.js)

Which can be obtained in your Stripe dashboard. Stripe offers a test environment, there's no need to use real payment data.

Run the webserver

docker-compose up

The database and the webserver will now be up.

Migrations

To create all the tables in the database Django uses something called migrations:

docker-compose exec django python manage.py migrate

Create admin user

docker-compose exec django python manage.py createsuperuser

Tests and linting

For testing we are using the Django testing module and for linting Flake8.

You can run both using nox.

docker-compose exec nox

Without Docker

Requirements

  • Python>=3
  • PostgreSQL

Env vars

cp .env.example .env
cp crossbox/static/js/custom/.env.js.example crossbox/static/js/custom/.env.js

And edit them. The minimum are:

DB_HOST (.env)
DB_PORT (.env)
DB_NAME (.env)
DB_USER (.env)
DB_PASSWD (.env)
DJANGO_STRIPE_PUBLIC_KEY (.env)
DJANGO_STRIPE_SECRET_KEY (.env)
stripe_publishable_key (.env.js)

Stripe secrets can be obtained in your Stripe dashboard. Stripe offers a test environment, there's no need to use real payment data.

Install

Create a virtualenv with Python>=3 with your preferred tool and install the package and the dev requirements to run the tests:

pip install -e .
pip install -r requirements-dev.txt

In this snippet the installation of the module is set as editable in order to keep the code in the same location, but you can do as you wish.

Run the webserver

And run it

python manage.py runserver

Migrations

To create all the tables in the database Django uses something called migrations:

python manage.py migrate

Create admin user

python manage.py createsuperuser

Tests and linting

For testing we are using the Django testing module and for linting Flake8.

You can run both using nox.

nox

About

Crossbox - App used to reservate sessions in Crossbox Palau (Django)

Resources

License

Stars

Watchers

Forks

Packages

No packages published