Giter Club home page Giter Club logo

minerva's Introduction

Minerva


Common Backend for Minerva

Collect all similar endpoints in the app/controller folder. Use different files for logically dissimilar endpoints.

NOTE: Most of the general config is loaded into the environment from the .env file which should be created from the provided .env.template

Setting up the project locally

Please use pipenv.

To install pipenv run pip install pipenv.

Use a separate virtual environment by running pipenv shell --three and then run pipenv install to install dependencies.

NOTE: Run pipenv install --dev to install all dependencies including development.

Adding new dependencies

To install a new dependency, use pipenv install <pkg-name>. This will update Pipfile and Pipfile.lock

NOTE: use the flag --dev if it is a development dependency.

To upgrade a package, use pipenv install --selective-upgrade <pkg-name>.

Whenever a new dependency is added, be sure to run

pip freeze > requirements.txt

Mention dependency change in the commit message.

Using Makefile

We serve most of the common commands collected in a Makefile.

Initial installation

make install

Run tests

make tests

Run server (not recommended for Production)

make run

Run all commands at once

make all

Docker Container

To build the container, make sure that the Dockerfile is present and run docker build -t minerva:latest .

To run the application from the docker container, run docker run minerva ARG where ARG can be db, run, test, shell or runserver.

For more information, run docker run common-backend --help.

Setting up DB Migrations

First Time With Flask-Migrate

If this is the first time that flask-migrate is being installed or run alongside existing database, use the following command to create a head stamp in your database:
python manage.py db stamp head

If the migrations folder doesn't exist, use the following command before the above command.

python manage.py db init

Applying Schema Update On Existing Database

It is recommended to perform Database upgrades, whenever database schema is updated, using the below commands:
python manage.py db upgrade

Removing Last Schema Update On Existing Database

Remove the last database update using the below commands:
python manage.py db downgrade

Updating Schema

Whenever a database model's schema is update, run the following command to generate migrations for it.
python manage.py db migrate

minerva's People

Contributors

dependabot[bot] avatar rashil2000 avatar

Stargazers

Mukul Mehta avatar Dibya Prakash Das avatar Ameya Deshmukh avatar  avatar

Watchers

James Cloos avatar Mukul Mehta avatar Ameya Deshmukh avatar

minerva's Issues

Look for alternatives to OMDB

Right now, we rely on the OMDB API to fetch information for each post and feed it to our database and Elastic for Indexing. There are certain limitations with it and it would be great if we could find an alternative data source for all (Or a large number) of IMDB entities

Dockerize Setup!

To make setup easy, we could use Docker and Docker Compose to manage containers. We'll need to write a Dockerfile for the backend service along with containers for MySQL and Elasticsearch

For an example, you could have a look at https://github.com/lttkgp/C-3PO

Generate ReDoc documentation

Generate documentation using ReDoc or other tools showing examples of API requests, parameters and responses. We also need to host the docs someplace to make it easier for contributors to understand the specific endpoints

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.