Skip to content

A Django web application that uses MapBox to show thousands of outdoor basketball courts all around the United States

Notifications You must be signed in to change notification settings

joebobdave/Bounce

 
 

Repository files navigation

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.

Image

Contributing

Features

  • Basketball court listing of outdoor courts near specified address/location
  • Light and Dark Theme for Maps
  • GraphQL / REST API endpoint

Next Steps

  • Implement more testing and test coverage (API, Model, End to End Testing with Cypress.io
  • Building CI/CD pipeline and linting for better code reviewing and deployment
  • Interfaces for User Feedback
  • Ensure pages are mobile friendly

Future Plans!

  • Load courts through REST / GraphQL API
  • User Accounts
    • Court Ratings
    • Save frequently visited courts
    • Submit Court to be added to Map
  • Decouple front and backend

Tech

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

  • Heroku - PAAS to Host Bounce
  • Django - Python Web Framework
  • LocationIQ API - used to get reverse geocoding results for markers
  • Mapbox API - used to provide forward-geocoding results and mapping
  • PostgreSQL - SQL database for scalability, modularity, and geoquerying support

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

    • ⚠️ 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.

About

A Django web application that uses MapBox to show thousands of outdoor basketball courts all around the United States

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 42.4%
  • JavaScript 38.9%
  • HTML 9.4%
  • Python 9.2%
  • Other 0.1%