GithubHelp home page GithubHelp logo

h-amg / xhominid-website-and-backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 10.02 MB

A flask website and back-end hosted on google cloud app engine

Home Page: http://xhominid.com/

License: Apache License 2.0

Python 95.33% CSS 1.07% JavaScript 2.32% HTML 0.44% Mako 0.06% C++ 0.02% C 0.22% SCSS 0.53%

xhominid-website-and-backend's Introduction

alt text  XHominid Web App

A Flask website and Backend server for an Android nutrition coaching and meal planning app.

check out XHominid on google play:      alt text

Also check out the android app github repo

Introduction

XHomind is a platform that helps people looking for nutrition coaching and meal planning get connected with a qualified professional nutritionist. The platform enables professional nutritionists to conduct nutrition assessment interviews through XHomind video call feature. After this assessment the user then gets access to weekly meal plans prepared by the nutritionist, they are then able to directly message the nutritionist for further questions via XHominid messaging feature. In order to maintain continuous progress the users are able to book weekly one to one coaching sessions with their nutritionist via the video call booking feature. The user is able to view meal information, recipes and cooking instructions as well as mark meals eaten throughout the day. The daily nutritional intake logs are uploaded instantly and made accessible to the user nutritionist so that the can advice and guide them when needed and make improvements to the upcoming weeks' plan.

Screenshot

alt text


Components

Webhook module

  • Handles user onboarding, collects the necessary data required to design a diet plan and calculates the daily micro-nutrients intake required for the user to achieve their desired nutritional goal.
  • Retrieves macro-nutrients data about a specific food item from Edamam nutrition database Api and returns the result to client App.
  • Updates user cuurent weight or target weight and produces the appropriate progress feedback that gets diplayed by client App.
  • Checks user dietary intake and verifies whether a specific food item can be had without exceeding the daily micro-nutrients intake limit.
  • Logs micro-nutrients of food items consumed by the user and calculates the remaining permissible micro-nutrients amount for the rest of the day.

User module

  • Logs the website administrator and nutritionists in and out.
  • Displays the administrator dash board after authentication, which enables the admin to view/downlaod email sign-ups from the landing page.
  • Displays the nutritionists' dashboard after authentication, which enables them to conduct counseling sessions through video calls.

Twilio module

  • Retrieves Twilio chat access token from twilio backend server.
  • Retrieves Twilio video access token from twilio backend server.

Main module

  • Displays the index, promotion and privacy policy pages.
  • Collects user emails from the index page and promotion sign up forms and saves it to the database.
  • Collects and sends analytics data to Mixpanel.

Billing module

  • Verifies and valiadte purchase tokens received from client.
  • Updates purchases and subscriptions record on the database.
  • Updates user susbscription status and expiry date.

API module

  • Exposes an Api endpoint for email signups that collects signee email and saves it to the database.

Stack

Front-end

  • HTML, CSS, JavaScript

Back-end

  • Flask/Python
  • JavaScript
  • Twilio Video
  • Twilio Chat
  • MongoDB stitch
  • MongoDB Atlas
  • Firebase Cloud Storage
  • Firebase Cloud Messaging
  • Google cloud - App engine

Database

  • MongoDB Atlas
  • Google cloud - Cloud Sql: PostgreSQL

Acknowledgements

In developing this project I used and modified a boilerplate open source flask App: Flask-Landing by Michael Herman

Blog

Check out my medium blog post From zero to published about my experience building this project and the challenges that came along with it.


Setup

Installation

  1. Clone this repo
  2. Create and activate a virtual environment
  3. Install the dependencies using requirements.txt

Configure Flask

Go to config.py:

  • Specifiy a secret key that will be used to encrypt your cookies.
  • specifiy your database URI to configure flask to work with your SQL database.

Set Environment Variables

During the local development process you can use the default configuration:

$ set APP_SETTINGS=app.config.DevelopmentConfig

When ready to deploy and after modifiting the production configurations in config.py you can use this variable:

$ set APP_SETTINGS=app.config.ProductionConfig

If you're using google's cloud SQL set this env. variable to the path of your json credential file to give flask access to you database:

$ set GOOGLE_APPLICATION_CREDENTIALS=silent-base-230717-54ef7bc5ff66.json

Create DB for local development

$ python manage.py create_db
$ python manage.py db init

Initiate models/tables.

$ python manage.py db migrate 

Create default admin credentials and data values. Found here.

$ python manage.py create_admin 
$ python manage.py create_data

Migrating DB

Update DB with new models as found in app/models.py.

$ python manage.py db migrate
$ python manage.py db upgrade

Run server

$ python manage.py runserver

Run tests

Without coverage:

$ python manage.py test

Without coverage and limited to a module inside "tests" directory

$ python manage.py test --test_name=test_endpoints

With coverage:

$ python manage.py cov

xhominid-website-and-backend's People

Contributors

h-amg avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.