Skip to content

googleinterns/step82-2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Serving a react app with a flask server

Project overview

This project shows how to serve a simple react application created by create-react-app with a flask server.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Ensure that you have the following tools available on your machine;

  • Git A distributed version control system
  • Python A general purpose programming language
  • node A JavaScript runtime
  • A tool to create isolated Python environments preferably Virtualenv
  • Pip A tool for installing python packages
  • create-react-app A supported way of creating single-page React applications
  • yarn A package manager for javascript

Installing

While in your preferred terminal;

Start by cloning the repository to your local machine

git clone https://github.com/googleinterns/step82-2020.git

cd step82-2020

Make and activate a python virtual environment using virtualenv

virtualenv venv (alternatively: pyhton3 -m venv venv)

source venv/bin/activate

With the virtual environment activated, install the project dependencies for the flask server

pip3 install -r requirements.txt
cd react-app/
yarn install

Serving the application

You can start a local server by opening two terminals and running

cd react-app
npm run start
cd flask-server
python3 main.py

visit http://127.0.0.1:3000/ to view your application.

Build the application for production

You can start a local server by opening two terminals and running

cd react-app
npm run build
cd ../flask-server
python3 main.py

visit http://127.0.0.1:5000/ to view your application.

Built With

  • Flask - A python web framework
  • React - A JavaScript library for building user interfaces

Authors

See also the list of contributors who participated in this project.

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published