SportsMatch encourages people to be more active by enabling them to find fellow racket sports fans to play a game with. This application serves as the backend for our final project at Makers Academy. You can find our frontend app here.
The team consisted of:
Technologies used
- Python
- Flask
- Pylint (to check code quality)
- Pytest (unit testing)
- BCrypt
- TravisCI
- SQLAlchemy
- PostgreSQL
We have 31 passing tests with an 89% test coverage.
The project has been deployed to Heroku.
https://trello.com/b/Twlp2CTz/sportsmatch
https://github.com/jessmar94/sportsmatch_api/wiki
- Clone this repository.
- Install pipenv:
$ brew install pipenv
$ cd path/to/directory
$ pipenv --three
- Enter the virtual environment:
$ pipenv shell
$ pipenv install
- Create an .env file in the home directory and add the following:
export FLASK_ENV=development
export FLASK_ENV_TEST=test
export DATABASE_URL="postgres://localhost/sportsmatch_api_db"
export JWT_SECRET_KEY=[ADD_SECRET_KEY_HERE]
export TEST_DATABASE_URL="postgres://localhost/sportsmatch_api_test_db"
- Run database migrations:
$ python manage.py db upgrade
$ python manage_test.py db upgrade
- Run the app:
$ python run.py
- Run the following command in your terminal:
$ py.test --cov=src --cov-config .coveragerc --cov-report term-missing
To check code quality for all python files in a directory and it's subdirectories
$ pylint **/*.py
As a keen tennis player,
So I check out SportsMatch,
I want to be able to signup.
As a keen tennis player,
So I can keep my account secure,
I want to be able to login and logout.
As a keen tennis player,
So I can always keep my information up-to-date,
I want to be able to update my information on my profile.
As a keen tennis player,
So I can find a fellow racket-sport fan,
I want to be able to see other players on the platform.
As a keen tennis player,
So I can plan my week,
I want to be able to see all my games coming up.
As a keen tennis player,
So I can arrange a game of tennis with someone,
I want to be able to request a game with a player.
As a keen tennis player,
So I can accept a fellow tennis player game request,
I want to be able to respond to their game request.
As a keen tennis player,
So I can keep track of my wins,
I want to be able to record who won the game I organised.
As a keen tennis player,
So I can feel proud of all my wins,
I want to be able to see the results of my games.
As a keen tennis and squash player,
So that I can also find squash players,
I want to be able to choose my sport from a few options.
-
Players Table ID | first_name | last_name | email | password | ability | gender | dob | postcode | rank_points | profile_image | bio | sport
-
Games Table ID | opponent_id | organiser_id | status | game_date | game_time
-
Results Table ID | game_id | winner_id | loser_id | result_confirmed
-
Messages Table ID | game_id | sender_id | organiser_id | opponent_id | content
-
Players can have many games
-
Players can have many results
-
Players can have many messages
-
Games can have one result
-
Games can have many players
-
Results can have many players
-
Results can have one game
-
Messages can have many players
-
Messages can have one game
If we had more time, we would have looked to implement the following features:
- Ability to submit the score of the game.
- Ability to register with multiple sports, rather than picking just one.
- Ability for player to input their availability for other players to see - this would require creating an Availability table.
- Ability to register the result of a game as a draw.
- Add in a weather API to help players pick the best day to play.