Skip to content
/ saturn Public template

A starter template with a node/react frontend and a python/flask backend.

License

Notifications You must be signed in to change notification settings

pcsagan/saturn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saturn

Tests: Passing Code of conduct License: MIT

NodeJS Typescript ReactJS NextJS Material-UI Python Flask

Features

Usage

First create a .flaskenv file to setup the environment variables

FLASK_APP="application:create_app()"
SECRET_KEY="SECRET"
JWT_SECRET_KEY="SECRET"

# These are available as default parameters for the 'flask run' command
FLASK_RUN_HOST="0.0.0.0"
FLASK_RUN_PORT=1122
FLASK_RUN_RELOAD=False
FLASK_RUN_DEBUGGER=False

# Breakpoints not hit when run from embeddable Python
# https://github.com/microsoft/debugpy/issues/890
PYDEVD_DISABLE_FILE_VALIDATION=1

To populate the database with test data run the following command in the backend directory after installation

flask --debug remake

Start the frontend by launching node in a terminal in the frontend directory

npm run dev

Start the backend by launching flask in a terminal in the backend directory

flask --debug run

VSCode

Debug the application with the following launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "cwd": "${workspaceFolder}/frontend",
      "command": "npm run dev",
      "name": "node",
      "request": "launch",
      "type": "node-terminal"
    },
    {
      "cwd": "${workspaceFolder}/backend",
      "name": "flask",
      "type": "python",
      "request": "launch",
      "module": "flask",
      "args": ["--debug", "run"],
      "jinja": true,
      "justMyCode": false,
      "consoleTitle": "flask"
    }
  ]
}

Ports (development)

The frontend listens on port 80 because of the --port 80 argument on the dev script in package.json

{
  "scripts": {
    "dev": "next dev --port 80"
  }
}

The backend listens on port 1122 because of the FLASK_RUN_PORT environment variable in .flaskenv

FLASK_RUN_PORT=1122

License

This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.

See LICENSE for more information.

About

A starter template with a node/react frontend and a python/flask backend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published