Coder Social home page Coder Social logo

react-flask-clock's Introduction

React-flask-clock

Screenshot

Simple website that displays the current time. Made using the React and Flask frameworks, inspired by https://blog.miguelgrinberg.com/post/how-to-create-a-react--flask-project.

Step 1. Create the React App.

  • Use 'create-react-app' to create the default React application.
  • Configure a proxy to the backend in package.json. Make sure to use "http://127..." (the number).
  • npm install
  • npm start

Step 2. Create the Flask API Backend.

  • Create the 'api' directory, which will contain the Flask Backend.
  • Initialize a python virtual environment using the pre-installed venv tool.
  • source venv/bin/activate
  • Use pip3 to install the flask and python-dotenv packages. Python-dotenv allows environment variables to be automically imported into the environment.
  • pip3 install -r requirements.txt
  • Update the default React .gitignore to account for Python/Flask
  • Start the server with 'flask run'.

Step 3. Install Material UI.

  • npm install @mui/material @emotion/react @emotion/styled
  • npm install @fontsource/roboto
  • npm install @mui/icons-material

Step 4. Deploy on Google App Engine.

  • Both the frontend and the backend can be deployed onto a single app engine project on Google Cloud. The required files are 'requirements.txt' and the '*.yaml' files. 'dispatch.yaml' dispatches URL requests to the backend or the frontend. By using multiple .yaml files you can deploy an app engine app using multiple 'services'.
  • Use the command 'gcloud app deploy app.yaml dispatch.yaml api/backend.yaml'
  • Before deploying the frontend app, make sure you've created the /build folder by running 'npm run build'.
  • npm run build
  • gcloud app deploy app.yaml dispatch.yaml api/backend.yaml
  • gcloud app browse

Step 5. Use Datastore as the NoSQL Database.

react-flask-clock's People

Contributors

jessdejong avatar

Watchers

James Cloos avatar  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.