Skip to content

allofphysicsgraph/ui_v7_website_flask_json

Repository files navigation

This repo is the source code for the website https://allofphysics.com, aka https://derivationmap.net/. See developer documentation after reading the user documentation

Files not in this repo

You won't be able to immediately use the code because there are four files which you need to create associated with SSL certificates:

  • certs/dhparam.pem
  • certs/fullchain.pem
  • certs/privkey.pem
  • .env

How to generate those files depends on whether you're running a website locally or on the Internet.

local webpage server

If you are on a local computer then see certs/README.md for instructions on generating local certificates.

The .env file contains three lines,

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
SECRET_KEY=

If you are on a local computer then you can set the values to be random strings.

web server on the Internet

If you are putting a webpage on the Internet then certs/*.pem are generated by Let's Encrypt. See https://physicsderivationgraph.blogspot.com/2021/10/periodic-renewal-of-https-letsencrypt.html

The .env file contains three lines,

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
SECRET_KEY=

If you are putting a webpage on the Internet then the string values come from Google Cloud Console under "APIs & Services" > "Credentials" by creating a "Web application" type client.

How to use (for the impatient)

For Docker installation see https://docs.docker.com/desktop/install

Assuming you already have git and docker available,

First time here? Get started with

git clone https://github.com/allofphysicsgraph/ui_v7_website_flask_json.git

If running locally,

cd ui_v7_website_flask_json/flask/
make docker_build
cd ..
make launch_webserver_interactive 

See developer documentation after reading the user documentation

Not your first time here: Quickstart for returning to an existing instance

docker compose up --build --remove-orphans

As a two step process:

docker-compose build --progress tty
docker-compose up

On DigitalOcean server:

docker-compose up --build --remove-orphans --detach

or

docker-compose up --build --force-recreate --remove-orphans --detach

Software Requirements

  • Docker
  • git
  • make
  • a web browser

Software Versions

Because software is in Docker containers (for reproducibility), the versions of the Docker software you're using matter. The software in this repo has been tested with

Troubleshooting and development

docker-compose instructions are from from https://github.com/ChloeCodesThings/chloe_flask_docker_demo and https://codefresh.io/docker-tutorial/hello-whale-getting-started-docker-flask/

combining flask, gunicorn, nginx is from https://testdriven.io/blog/dockerizing-flask-with-postgres-gunicorn-and-nginx/

nginx timeout https://wiki.ssdt-ohio.org/display/rtd/Adjusting+nginx-proxy+Timeout+Configuration

Licensing

Unless otherwise noted, all source code is covered by the Creative Commons Attribution 4.0 International License

Contributing

See CONTRIBUTING.md for guidance.

#EOF

About

version 7 of the Physics Derivation Graph UI: a flask-based website with JSON backend

Topics

Resources

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors