full-stack-template icon indicating copy to clipboard operation
full-stack-template copied to clipboard

Python backend(s)

Open keskiju opened this issue 6 years ago • 0 comments

Implement some python backend(s) in alternatives/:

  • [x] Flask with uWSGI: alternatives/server-flask
  • [ ] Bottle with uWSGI: alternatives/server-bottle (use the existing server-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. Return HTTP 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. Return HTTP 200 response if everything is ok.
  • [ ] Logging formats: text logging format for local development and stackdriver 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.

keskiju avatar Jul 09 '18 09:07 keskiju