senior-dev-1019 / sushan-reactapp-flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/learningdollars/sushan-reactapp-flask.git

cd sushan-reactapp-flask/

Make and activate a python virtual environment using virtualenv

virtualenv 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 running

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


Languages

Language:JavaScript 88.4%Language:HTML 9.6%Language:CSS 1.6%Language:Python 0.5%