https://github.com/inria/mooc-accessibility-api
Inria MOOC Accessibilité Numérique API
https://github.com/inria/mooc-accessibility-api
api flask python36
Last synced: about 2 months ago
JSON representation
Inria MOOC Accessibilité Numérique API
- Host: GitHub
- URL: https://github.com/inria/mooc-accessibility-api
- Owner: INRIA
- Created: 2019-10-30T12:43:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T00:42:41.000Z (about 5 years ago)
- Last Synced: 2025-05-12T14:04:44.438Z (about 1 year ago)
- Topics: api, flask, python36
- Language: Python
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Inria Digital Accessibility MOOC API
This web application handles Inria MOOC Accessibility web player events. Its
main purpose is to act as a gateway between the web client and an
[ElasticSearch](https://www.elastic.co/products/elasticsearch) server.
## Requirements
- [python](https://www.python.org) `=3.6`
- [Pipenv](https://pipenv.kennethreitz.org/en/latest/)
## Installation
```sh
pipenv install
```
For development purpose, you also should install additional packages:
```sh
pipenv install --dev
```
The application assumes ElasticSearch is used to save records. If no
ElasticSearch server can be found, it will just output errors and return `500`
errors.
Most straightforward installation requires Docker. Just `cd` into the
application directory and run `docker-compose up`.
Running this command will start an ElasticSearch server on
`http://localhost:9200` and a Kibana instance on `http://localhost:5601` to
visualize events.
### Linting
```sh
pipenv run lint # runs pycodestyle
pipenv run lint_fix # fixes malformed code
```
## Run the application
### Development
```sh
cd /path/to/mooc-accessibility-api
pipenv run serve_dev
```
Application will be served through built-in Flask server on port `3001`.
### Production
[Gunicorn](https://gunicorn.org/) is provided as a dependency, and should be the
prefered way to serve the application in production.
```sh
# numbers of workers depend on the machine hosting the application
pipenv run gunicorn --workers=3 --bind=127.0.0.1:8000 wsgi:application
```
### Note About Logging
Logs are written to `STDERR` and `STDOUT`. This can be overridden by configuring
the wsgi app container.
### Environment Variables
The `.env` file hosts a few variables you may need to change before running the
application.