Coder Social home page Coder Social logo

data-app-boilerplate's Introduction

Data-App-Boilerplate

Some boilerplate code for building applications that have a lot of data-science smarts in the background. Ready to deploy to production on AWS in less than an hour!

Includes user authentication using Auth0.

  • Python 3
  • React.js
  • React Redux
  • Redux Sagas
  • Auth0 authentication
  • Postgres + SQLAlchemy
  • FlaskMigrate
  • Webpack
  • Docker

To deploy to Amazon:

Install Docker locally

https://www.docker.com/

Install the Amazon CLI with ability to deploy docker images to ECR

aws configure --profile ECS

Install Front-End Requirements

From project direcotry:

npm install

Install Python Requirements for local editing:

pip3 install -r requirements.txt

(consider using a virtual environment https://docs.python.org/3/tutorial/venv.html)

Upload Docker Images to amazon ECR

(make sure you have an account set with permission to call ecr:GetAuthorizationToken )

  • Create a repository in the Amazon EC2 Container Registry in your chosen geographic location ( for example https://ap-southeast-2.console.aws.amazon.com/ecs/home?region=ap-southeast-2#/repositories for Amazon's AP-Southeast-2 region) and create a new repository.

  • In in your project files 'dockerrun.aws.json' and 'build_ecs.sh', wherever you see '[PUT YOUR REPOSITORY URI HERE]' (there are 4 places in total), paste in the URI for the repository you just created ( looks like 290492953667.dkr.ecr.ap-southeast-2.amazonaws.com/databoilerplate). WARNING, you cannot have a space in the variable definition in build_ecs.sh. That is:

REPOSITORY_URI=290492953667.dkr.ecr.ap-southeast-2.amazonaws.com/boilerplate

is good

REPOSITORY_URI = 290492953667.dkr.ecr.ap-southeast-2.amazonaws.com/boilerplate

is Bad

  • In 'build_ecs.sh' modify [PUT YOUR REGION HERE] to the region you are deploying in (eg ap-southeast-2)

  • run build_ecs.sh

bash build_ecs.sh

Deploy app

In terminal run:

eb init

(Choose a location, don't set up source control or SHH, and accept defaults for everything else)

eb create

(Choose a name you like and then defaults)

eb deploy

(accept defaults)

Set up DB

Optional: Set up Auth0

  • Go to www.auth0.com and create an account. Update the [Auth0] fields in config_files/prod_config.ini with your own settings. In the auth0 settings, be sure to add your domain to the allowed web origins and CORS origins. Also consider adding local host

Update app with new settings

  • once again run build_ecs.sh and eb deploy

all done!

data-app-boilerplate's People

Contributors

enjeyw avatar

Watchers

 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.