An app where users can create a group with their friends, match with other groups and hang out
This is just the backend of the app, if you're looking for the frontend: https://github.com/damianstone/toogether-mobile
- π Django REST framework
- π₯ Websocket (channels)
- π Geolocation with Gdal, Geos and Postgis
- π§Ή Frake8 and black
- π PostgreSQL
- πΌοΈ Amazon S3
- π Token authentication
![](https://private-user-images.githubusercontent.com/63305840/293102109-6c31f272-addc-47e2-bd72-a26a71a46094.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDI1NzEsIm5iZiI6MTczOTIwMjI3MSwicGF0aCI6Ii82MzMwNTg0MC8yOTMxMDIxMDktNmMzMWYyNzItYWRkYy00N2UyLWJkNzItYTI2YTcxYTQ2MDk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE1NDQzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTljZDMyMDg4Y2UwOTQxNjQ0NWQxNDRiNjE0NjY2YTUwMTI0NWQyZjczYjAyYTJmY2U0YzdmOWYwODA4Mzc1NTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.OLWRulRas0Yho_zirFqvSu6ufKqiepHaZ7_6IrzRfNY)
- Login and registration with auth token
- Create profile
- Report profiles
- Block profiles
- Password recovery with email verification
- Update your personal information
- Add photos
- Support single and group profiles
- Like
- Unlike
- Undo
- Create a groups
- Invite friends using unique link
- If admin (creator of the group): remove and add members
- If not admin, join to group using the link and leave
- Group chat generated autmatically when joining our creating a group
- For know the chat just support text messages
- Chat with your matches
- Delete matches
- Report and block profiles
List based on
- Your location
- Age
- Gender
- Preferences
- Group sizes
- More above in this documentation!
mailto: [email protected]
For IOS / Linux
python3 -m venv venv-people
source venv-people/bin/activate
For Windows
python -m venv venv-people
venv-people\Scripts\activate.bat
pip install -r requirements.txt
LOCAL_DB_NAME=name-of-the-database
LOCAL_DB_USER=db-user-name
LOCAL_DB_PASSWORD=db-password
LOCAL_DB_HOST=host-you-want-to-use
LOCAL_DB_PORT=post-you-want-to-use
Inside api
create a new folder called migrations
and inside add the following file:
__init__.py
Depending on your operating systems the installation can be quite different therefore we recommend you to follow the official documentation for this:
https://docs.djangoproject.com/en/4.1/ref/contrib/gis/install/geolibs/
python manage.py makemigrations
python manage.py migrate
Creating a superuser will give you administrative privileges, and most important, access to our local internal endpoints for development purposes
When running the command, choose a memorable email and password
To create a superuser account, use the following command:
python manage.py createsuperuser
python manage.py runserver
In the following link you can see the different installations for different operating systems
https://redis.io/docs/getting-started/installation/
redis-server
killall redis-server
To format the code in the project, simply run the following command in the root directory of the project:
black .
This command will automatically format all .py files in the project according to the black style guide, which adheres to the PEP 8 style guide
Make sure you run this command before any pull request
Before any merge to develop or rocket, it will be necessary to make a Pull Request and a code review.
Basic PR structure:
your-branch
-> feature-branch
-> develop
-> rocket
- Push your branch to the remote repository: git push
- Navigate to the GitHub website
- Create the pull request (PR) manually by selecting the correct
feature-branch
you are working on and clicking on the "New pull request" button - Notify the team about your PR through our communication channel: Discord
Geolocation: GDAL, Geos and PROJ: https://github.com/heroku/heroku-geo-buildpack
Using the following link: https://devcenter.heroku.com/articles/heroku-cli
Login and check the apps
heroku login
heroku apps
From the heroku branch run the following
python mangage.py makemigrations
python manage.py migrate
python manage.py collectstatic
In order to use the last builpacks of GDAL and Geos, make sure you do not have set BUILD_WITH_GEO_LIBRARIES
If you do, run the following command
heroku config:unset BUILD_WITH_GEO_LIBRARIES --app toogether-api
Besides, as we are collecting then static files manually, we need to disable the auto coollect static
heroku config:set DISABLE_COLLECTSTATIC=1 --app toogether-api
git push heroku
Heroku website panel -> Deploy -> Manual branch deploy
Delete all the folders and files inside the static
, this is because when the code is deployed,
the static files are automatically collected, but, in order to keep the repository clean,
those files must be deleted once the deployment is successful.
To check the logs
heroku logs --tail --app toogether-api
The views in Together are divided into three main areas to cover the application's features: Profile views, Group views, and Swipe views.
In Together, there is a single data model for users known as the profile model. The distinction between a user and a profile is that a user may log into the app but has not yet created a profile.
User views
These views manage the basic functionality of the user model, such as creating and deleting a user.
Profile Modelview
This set of views manages all the actions that a user can perform on their profile, such as adding photos, updating information, and blocking other users.
These endpoints manage all the actions related to groups, such as creating a group with friends and removing members.
The swipe views manage the "liking" functionality between users, as well as the matchmaking algorithm
. This includes all the processes and calculations involved in determining the profiles that a user is matched with. These views are an integral part of the application as they enable the core user interaction and facilitate the potential formation of relationships.
The matchmaking algorithm in Together is responsible for determining the matches between profiles and groups. This process is initiated when a user "likes" another profile or group.
The algorithm is implemented in the like function and uses several checks to determine the nature of the like being given. There are four possible scenarios for a like:
- One profile to one profile
- One profile to a group
- A group to one profile
- A group to another group
Each scenario is handled by a different function that performs the necessary operations to determine the match.
request
: a Django request objectcurrent_profile
orcurrent_group
: the profile or group making the likeliked_profile
orliked_group
: the profile or group being liked
A Django response object containing:
details
: a string indicating the status of the like, eitherLIKE
,ALREADY_MATCHED
,NEW_MATCH
orSAME_MATCH
group_match
: a string indicating whether the match was between groups:NEITHER
,BOTH
,LIKED
orCURRENT
match_data
: the match serialization in case a new match was created, otherwise this field will not be present.