Skip to content

MaxwellEdisonBay/Mango-Python-Server

Repository files navigation

Mango App API

Idea

The idea is to create a RESTful API and web application for preparing card queries for Kotlin mobile application. Mango App API interacts with Firebase Realtime Database, gets the required data, applies some search and classification algorithms and provides an output JSON for the mobile app. Also, API processes smaller requests such as like someone, change user data etc.

Expected basic functionality

  • Database connection and query processing
  • Simple requests from Kotlin frontend processing
  • Profile search algorithm
  • Minimalistic website
    • Login / registration form
    • Beautiful UI/UX
    • Mobile app link

Future expansions

  • Better locations
    • GPS timestamp
    • Distance calculation + search matches in a distance range
    • Google Maps API - more location functionality
  • Text bio ML classification algorithm
    • Polynomial Bayes / SVM multi-class classification
    • Hidden user classification, improved search
  • Database optimization, SQL
  • Events nearby
    • Facebook/VK API
    • Local events parsing into JSON
    • Event recommendations
  • Message tips to start up a conversation
  • Gamification, more mechanics for comfortable UX (experimental, A/B-tests)
  • Guidelines violation filter
    • image recognition
    • Keras machine learning classification

Search algorithm main goals

  • Provide the best match for a user according to given parameters
  • A user gets content even though there is no matches
  • All the given profile bunches must be tracked to avoid unwanted card repetitions
  • developing

Packages

firebaseConnector.py

Handles all the database interaction, queries processing and data fetching.

Method Arguments Description Returns
requestsProcessor Main HTTP requests listener, calls other methods to process received requests
submitLike user_id_send : String, user_id_liked : String Adds user id into liked user's tree in DB, see database structure (used_id_send into users/{user_id_liked}/liked_me) Integer (success/fail code)
fetchUsersWithParams search_params: Params Fetches user profiles JSONs from DB according to given params List of User
evaluateUser users: User, search_params : Params Calculates how user profile fits required parameters Float (User weight coefficient)

app.py

Main web application package handling incoming HTTP requests and sending prepared data

test.py

Debug console app for testing HTTP requests on production

Technologies

Inspiration

API requests supported

Request Arguments Description Returns
like user_id_send, user_id_liked Like another profile and fill used_id_send into users/{user_id_liked}/liked_me result_code
get-cards _user_id_send Prepares and sends a set of profile cards according to user's search preferences JSON with a set of users cards

Firebase Realtime Database

Users

Main database node containing all the user profile data

image

Chats & Messages

Chats and chat messages nodes
* - node header

image

Heroku deploy

Actual production URL: https://mango-friends.com/

Web application is easy to be deployed in Heroku by using following commands:
$ heroku login
$ git add .
$ git commit -am "Heroku deploy"
$ git push heroku HEAD:master

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published