You need Python 3.9 to run this thing. It's split into two apps, the asset server that produces images on demand from the astool package cache, and the web server that produces the pages.
I recommend using docker - (almost) ready-made configs are available in
the variants
folder. Your docker-compose command will probably look like:
docker-compose -f docker-compose.yml \
-f variants/config.dev.yml \
-f variants/config.postgres.yml [build/up etc...]
You will need to make the following edits to the configs:
AS_POSTGRES_DSN
to point at the right
hostname. It's usually xxxxx_db_1
, where xxxxx is the name of the folder you
cloned this repo into (such as arposandra
).AS_IMAGE_SERVER
to point at the right hostname.
Do not use a docker-internal host because your browser will request images
from it.If you want to run the tools in the utils image, you need to follow the instructions to clone astool in the maintenance directory.
See doc/config.md
.
The web app code lives in the captain directory. The basic flow to add a new page is like this:
captain/__init__.py
.dispatch.route
decorator to add URLs to your page. Example:
from tornado.web import RequestHandler
from .dispatch import route
@route(r"/mypage/([0-9]+)")
class SomePage(RequestHandler):
def get(self, param):
self.write(f"Hello world! Your number was {param}.")
The CSS and Javascript code is in frontend/. Starting the js-dev docker container (defined in variants/config.dev.yml) will set up webpack-dev-server for you. No need to do anything on the host side anymore.
Remember to change the AS_WDS_HOST environment variable in config.dev.yml to either localhost, or an accessible host if testing on other devices.
See doc/localization.md
.
This section has been moved to skyfarer/README.md.