full-stack-template
full-stack-template copied to clipboard
Python backend(s)
Implement some python backend(s) in alternatives/
:
- [x] Flask with uWSGI:
alternatives/server-flask
- [ ] Bottle with uWSGI:
alternatives/server-bottle
(use the existingserver-flask
as an example). - [ ] FastAPI (or plain starlette):
alternatives/server-fastapi
- [ ] (optional: Django with uWSGI:
alternatives/server-django
) - [ ] (optional: Tornado:
alternatives/server-tornado
)
Each stack component must provide at least the following. Copy these from server/
and modify.
- [ ]
Dockerfile
: Dockerfile for local development - [ ]
Dockerfile.build
: Dockerfile for building docker images for server environments. It should contain a build stage that is named builder. - [ ]
test-suites
: List of api/e2e test suites. - [ ]
test.sh
: Shell script that runs a test suite or a single test based on given parameters. - [ ] Good conventions (folder structure, file naming, etc)
- [ ] Working
blog
example as implemented in full-stack-template. - [ ]
README.md
: Instructions for configuring the stack component for a project (if instructions are required).
Additional server requirements - Mandatory:
- [ ] Health check: Public endpoint
/healthz
should check that the server container is running ok. ReturnHTTP 200
response if everything is ok. - [ ] Uptime check: Public endpoint
/uptimez
should check that the server container is running ok, and all external systems (e.g. database) are also reachable. ReturnHTTP 200
response if everything is ok. - [ ] Logging formats:
text
logging format for local development andstackdriver
logging format (json) for server environments. See log.util.js as an example. NOTE: Do not log all request headers, as they might contain secrets.
Additional server requirements - Optional:
- [ ] Config values for clients: Public endpoint
/config
should return such config values that are required by clients (e.g. web UI). NOTE: Do not return any secrets or confidential configs! - [ ] Latency logging: Log latency of each response. See log.util.js as an example.
- [ ] DB pool status logging: pool size, number of reserved connections.
- [ ] Error ids: For each system error, return a generated error id in the response that can be used to find the error details from log.
- [ ] Sentry integration: See sentry.setup.js as an example.