Powered by Flask + Connexion + SQLAlchemy
Please see the open-source License.
| Branch | Status |
|---|---|
| Production | |
| Staging | |
| Experiment | |
| |
Environment variables can be used to set the configuration.
| Environment Variable | Description | Default Value |
|---|---|---|
| DEBUG | Enable verbose debug output | False |
| PORT | The port to serve the Flask app | 5000 |
| SWAGGER_URL | local or remote URL to the Swagger spec that this application uses | openapi/swagger.json |
You can choose to connect to a remote postgres instance, or use a local SQLite file (recommended for dev only)
| Environment Variable | Description | Default Value |
|---|---|---|
| USE_SQLITE | Use a local database file (instead of postgres, for local dev only) | True |
| POSTGRES_HOST | Hostname of a remote Postgres to connect to | localhost |
| POSTGRES_PORT | Port of a remote Postgres to connect to | 5432 |
| POSTGRES_USER | Username to use when connecting to remote Postgres | '' |
| POSTGRES_PASS | Password to use when connecting to remote Postgres | '' |
| POSTGRES_DB | Database to use when connecting to remote Postgres | ct2019db |
NOTE: By default, a sqlite file will be created.
This project can either be run with Python or as a Docker container.
To run all of ClassTranscribe locally (including the frontend and C# backend) see RunEverything.md
Install dependencies:
pip install -r requirements.txtRun the application:
python server.pyNavigate to http://localhost:5000/ui/ to test the API with Swagger UI.
Build the Docker image:
docker build -t classtranscribe/pyapi .Run a Docker container from that image:
docker run -itd --name ct-pyapi -p 5000:5000 classtranscribe/pyapiNavigate to http://localhost:5000/ui/ to test the API with Swagger UI.
NOTE: In Docker on Mac/Windows, you may need to use your IP address instead of localhost.
Build and run the pyapi application, along with postgres and rabbitmq:
docker compose -f docker/docker-compose.yml up -d --buildYou can change the code and/or .env files located in the Docker directory to change the behavior of the application.
NOTE: --build will automatically rebuild the Docker image needed for this stack
Navigate to http://localhost:5000/ui/ to test the API with Swagger UI.
NOTE: In Docker on Mac/Windows, you may need to use your IP address instead of localhost.