Giter Club home page Giter Club logo

covidx's Introduction

covidX

TL;DR Dive into coding right away by clicking here:

Open in Gitpod

Codacy Badge

DeepSource

CI

Open Source Helpers

We are an open community of volunteers without a commercial purpose. We believe that through a utilitarian approach, we can do the most good in the quickest time. Applying unused engineering we can help the world cope with the threat of COVID-19.

Python Version

covidX will be run on python 3.7.6 and 3.8.5

Required Services for Self-Hosting

The following steps are necessary in order to ensure that you are able to self-host your own instance of the project smoothly:

How to Run Locally Using Docker (docker-compose)

  • Build and start the app:
docker-compose up

The app should be built automatically on first run. Subsequent to the initial build, this same command can be repeated every time you want to start the app, without having to rebuild each time.

The local server will be visible at https://localhost:8000.

NB: To reflect changes made to .env.dev after the application has been brought up, you need to force a rebuild:

docker-compose up --build

How to Setup for Development

Setup a virtualenv and run:

CPPFLAGS="$(pg_config --cppflags)" LDFLAGS="$(pg_config --ldflags)" python3 -m pip install -r requirements.txt 

How to Build

No Docker: Local Machine Developer Setup

FIRST SEE HERE: https://forum.mycovidconnect.com/d/14-how-to-contribute-backenddjangopython-devs

Then:

  • Clone this git repo. SECRET_KEY and DEBUG env vars are in settings.py.

  • Pre-requisites:

export DEBUG_ENV=1
export SECRET_KEY=<YOUR_SECRET>
CPPFLAGS="$(pg_config --cppflags)"
LDFLAGS="$(pg_config --ldflags)"
  • and then build like:
bazel build :manage --watchfs --spawn_strategy=standalone --copt --aspects=@bazel_tools//tools/python:srcs_version.bzl%find_requirements --verbose_failures=true --show_timestamps=true --python_version=PY3 --build_python_zip --sandbox_debug --color=yes --curses=yes --jobs=20 --loading_phase_threads=HOST_CPUS --action_env=LDFLAGS --action_env=CPPFLAGS --action_env=DEBUG_ENV --action_env=SECRET_KEY
  • Collectstatic
bazel run -s :manage --watchfs --spawn_strategy=standalone --copt --aspects=@bazel_tools//tools/python:srcs_version.bzl%find_requirements --verbose_failures=true --show_timestamps=true --python_version=PY3 --build_python_zip --sandbox_debug --color=yes --curses=yes --jobs=200 --loading_phase_threads=HOST_CPUS --action_env=LDFLAGS --action_env=CPPFLAGS --action_env=DEBUG_ENV --action_env=SECRET_KEY -- collectstatic
  • Then Run it like:

With Debug Mode:

DEBUG_ENV=1 SECRET_KEY=dskaj343 CPPFLAGS="$(pg_config --cppflags)" LDFLAGS="$(pg_config --ldflags)" bazel run :manage --watchfs --spawn_strategy=standalone --copt --aspects=@bazel_tools//tools/python:srcs_version.bzl%find_requirements --verbose_failures=true --show_timestamps=true --python_version=PY3 --build_python_zip --sandbox_debug --color=yes --curses=yes --jobs=2000 --loading_phase_threads=HOST_CPUS --action_env=LDFLAGS --action_env=CPPFLAGS --action_env=DEBUG_ENV --action_env=SECRET_KEY -- runserver_plus 0.0.0.0:8000

Without Debug Mode:

bazel run :manage --watchfs --spawn_strategy=standalone --copt --aspects=@bazel_tools//tools/python:srcs_version.bzl%find_requirements --verbose_failures=true --show_timestamps=true --python_version=PY3 --build_python_zip --sandbox_debug --color=yes --curses=yes --jobs=20 --loading_phase_threads=HOST_CPUS --action_env=LDFLAGS --action_env=CPPFLAGS --action_env=DEBUG_ENV --action_env=SECRET_KEY -- runserver_plus

Create Docker Image: Local Machine Developer Setup

(If you don't know bazel, don't bother with this section.)

Make sure to follow the steps above. Then follow these steps:

  • Create a local docker bazel image
PULLER_TIMEOUT=3600 DOCKER_REPO_CACHE=$(pwd)/docker_repo_cache DEBUG_ENV=1 CPPFLAGS="$(pg_config --cppflags)" LDFLAGS="$(pg_config --ldflags)" SECRET_ID="SECRET_KEY" BUCKET_NAME="gae-bizlead" DJANGO_SETTINGS_MODULE="covidX.settings" WSGI_APPLICATION="covidX.wsgi.application" bazel run --watchfs --spawn_strategy=standalone --copt --aspects=@bazel_tools//tools/python:srcs_version.bzl%find_requirements --verbose_failures=true --show_timestamps=true --python_version=PY3 --build_python_zip --sandbox_debug --color=yes --curses=yes --jobs=2000 --loading_phase_threads=HOST_CPUS --action_env=LDFLAGS="$(pg_config --ldflags)" --action_env=CPPFLAGS="$(pg_config --cppflags)" --force_python=py3 --incompatible_use_python_toolchains=false  --loading_phase_threads=1 --http_timeout_scaling=2 :covidx_manage
  • Run bazel image using docker
docker run --rm -it -e SECRET_KEY=<YOUR_SECRET_KEY> -e DEBUG_ENV=1 -e CPPFLAGS="$(pg_config --cppflags)" -e LDFLAGS="$(pg_config --ldflags)" -e SECRET_ID="SECRET_KEY" -e DJANGO_SETTINGS_MODULE="covidX.settings" -e WSGI_APPLICATION="covidX.wsgi.application" --security-opt apparmor=unconfined bazel:covidx_manage runserver_plus

This should set you up for local development.

Installing Developer Packages

Setup a virtualenv and run:

python3 -m pip install -r requirements_dev.txt 

Google Cloud Deployment

DEPLOY like:

Enable following options on GAE:

gcloud app deploy app.yaml --verbosity=debug --stop-previous-version

Common Issues:

TODO/TBA:

  • How to contribute. Coming soon.
  • Project Roadmap

Credits

@codecakes

covidx's People

Contributors

codecakes avatar milan-tom avatar marcelloromani avatar elijahahianyo avatar premalrupnur avatar dependabot[bot] avatar deepsource-autofix[bot] avatar atuljain avatar xmunoz avatar deepsourcebot avatar swapniljha001 avatar codacy-badger avatar mend-bolt-for-github[bot] 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.