cfahlgren1 / Bounce

A Django web application that uses MapBox to show thousands of outdoor basketball courts all around the United States
https://bouncemap.com
19 stars 9 forks source link

Bounce - Basketball Court Finder

What is Bounce?

Bounce is a web app built in Django that locates and displays the nearest basketball courts in the area. With over 48,000 documented basketball across North America, there is bound to be one near you. The goal of this project is to build a community for basketball and other sports enthusiasts.

Home Page

image

Courts Page

Image

Contributing

Visit Contributing.md

Features

Future Plans!

Tech

Bounce uses a number of open source projects and APIs to work properly:

Setup

Docker

  1. Install Docker and Docker Compose

  2. Make docker_entrypoint.sh executable

    # Linux
    chmod +x docker_entrypoint.sh
  3. Start and build the 2 containers

    • --build builds the images defined in the docker-compose.yml file.
    • -d dettaches the terminal from the building process.
    • Finally the script from (docker_entrypoint.sh) is executed.
    # In the same directory as `docker-compose.yml`
    docker-compose up -d --build
    • If there are errors you can see the logs
      docker-compose logs
  4. Load Initial Database Models

    • It's also necessary to load in the fixtures when setting up the database:
      docker-compose exec web python manage.py loaddata bounce_data.json
  5. Go to http://localhost:8000

    • You should see the frontend of the project
  6. Enter a shell within the Docker container

    • To enter an interactive shell (in this case for the "web" service), you can use
      docker-compose exec web bash
  7. Create a superuser (Optional)

    • You may enter an interactive shell within the Docker container (in this case the container corresponding to the "web" service)

    • In the same directory as docker-compose.yml run

      # This open a bash shell inside the container
      docker-compose exec web bash
    • Then run python manage.py createsuperuser

    • Run exit to exit the container. It will keep running.

  8. To stop the containers run docker-compose stop

    • :warning: Be careful with docker-compose down which stops the container but also removes them.

Troubleshooting

Ensure that your .env file is present and the required variables are set. Sometimes starting fresh can help, since things like volumes will persist even after a container is removed, which can cause issues. You can remove all docker containers and volumes using the command:

docker-compose down && docker rm -f $(docker ps -a -q) && docker volume rm $(docker volume ls -q)

and then trying the above steps again.