The ClassClock API for storing and accessing schedule data https://api.classclock.app
  • Python 97.8%
  • HTML 1.1%
  • Mako 0.7%
  • Dockerfile 0.4%
Find a file
2025-09-03 22:04:52 -04:00
.github/workflows add action for deploying tags 2022-10-12 14:46:19 -04:00
.vscode automate ClassPeriod schema 2020-03-06 18:00:20 -05:00
blueprints exclude internal description from being returned to unauthenticated users 2025-09-03 18:35:10 -04:00
common exclude internal description from being returned to unauthenticated users 2025-09-03 18:35:10 -04:00
migrations add new fields and migration for them 2025-09-03 18:06:16 -04:00
templates update link to API docs 2022-02-13 19:02:48 -05:00
.dockerignore ignore virtual environments - make the container build its own 2025-05-21 23:22:22 +02:00
.gitignore add more complete python gitignore 2022-02-13 17:18:31 -05:00
api.py further update rate limits 2023-04-17 06:31:18 -04:00
auth.py refactor auth file to also allow the DATABASE_URL variable 2023-08-13 12:03:21 -04:00
CHANGELOG.md changelog update and version bump 2023-04-17 06:35:58 -04:00
CONTRIBUTING.md add CONTRIBUTING.md with some information on creating new migrations 2022-11-20 10:31:04 -05:00
createdb.py add demo data loader to createdb 2022-02-13 18:55:01 -05:00
Dockerfile reduce to 1 worker to help reduce memory usage 2025-05-21 23:49:52 +02:00
docs.py changelog update and version bump 2023-04-17 06:35:58 -04:00
fly.toml add some swap space to fly config to try and fix the memory issue 2025-05-21 10:25:23 +02:00
LICENSE Add AGPL Licanse 2019-07-23 11:42:46 -07:00
Pipfile limit flask-migrate to the previous major version so flask migration still works 2025-09-03 18:06:05 -04:00
Pipfile.lock limit flask-migrate to the previous major version so flask migration still works 2025-09-03 18:06:05 -04:00
README.md add source for TRUSTED_PROXY_COUNT docs claim that it can cause problems if set too high 2023-04-17 06:32:59 -04:00

ClassClockAPI

Docker Pulls

This is the backend that provides access to the ClassClock database.

Environment Variables

Environment Variable Default Purpose
DB_USERNAME no default. this value is required The username of the user to connect to the database with
DB_PASSWORD no default. this value is required The password of the user to connect to the database with
DB_HOST localhost the hostname where the database is located
DB_NAME classclock the name of the database to use if it is different
DB_CONNECTION_URL constructed based on the above values Allows the SQLAlchemy connection string to be manually set
AUTH0_DOMAIN no default The Auth0 api domain i.e. yourapp.auth0.com
API_IDENTIFIER no default Your Auth0 api identifier. This may be your API domain name. i.e. https://api.yourdomain.com
AUTH0_CLIENT_ID no default Your Auth0 Client ID
AUTH0_CLIENT_SECRET no default Your Auth0 Client Secret
SENTRY_DSN no default The dsn URL from the sentry.io setup in case you wish to set up error monitoring
TRUSTED_PROXY_COUNT no default The number of proxies that are in between users and the app itself. Setting this too high can create security problems. Setting too low can cause rate limiting to not work. see here for what this is used for

First time Setup

  1. Prepare an empty database and have its configuration information handy (login, hostname/port, db name .etc)
  2. Install all dependencies (including dev dependencies) using pipenv install -d
  3. set up a .env file with your database configuration settings from earlier
  4. create the db by running pipenv run python3 createdb.py. add the --demo flag to createdb if you want to include demo data.

After this you should be ready to run the API.

Docker

This API has been set up to run in a docker container.

The simplest way to run it is to:

  1. aquire the container either from a docker repository or by running docker build . -t classclock-api in a cloned version of this repo
  2. set up the environment variables you want per the above table
  3. use a command like docker run -p 8000:8000 --rm -it --env-file dev.env classclock-api:latest to run the container interactively using dev.env as the source of the environment variables. The app will start up on port 8000.

Contributing

If you are interested in making changes to the ClassClock API, see the CONTRIBUTING file for details on how to do so.