This is a simple API service, which allows to send tickets, update statuses, delete and comments they.
By default ticket creating with status 'opened'.
- Opened ticket can be 'answered' or 'closed'.
- Answered ticket can be 'awaited' or 'closed'.
- Awaited ticket can be 'answered' or 'closed'.
- Closed ticket can't be changed.
- Only not closed tickets can be commented.
You will need Docker to run it. Install last version depending from your OS. After installation just clone this repository.
First, open a .env.example file, set some variables and save it as .env without .example extension.
IMPORTANT: Make your own unique secret variables.
# Application secret key
SECRET_KEY=<YOUR_SECRET_KEY>
# Database config
POSTGRES_USER=system_admin //set own
POSTGRES_PASSWORD=<YOUR_DB_PASSWORD>
POSTGRES_DB=tickets //set own
# Redis config
REDIS_URL=redis://redis-service
REDIS_USER=default
REDIS_PASSWORD=<YOUR_REDIS_PASSWORD>
REDIS_EXPIRE_TIME=60 // set time for Redis TTL in seconds
# For version control
API_VERSION=v1
Start building and setting up.
docker-compose up
Service will accessible locally at 8000 port.
localhost:8000
The following endpoints are available.
/ticket- POST - create ticket
- Required form-data:
- theme: string
- text: string
- email: string
- Required form-data:
- POST - create ticket
/ticket/ticket_id- Required query param:
- ticket_id: int
- GET - get ticket
- PUT - update ticket status
- Required form-data:
- status: string
Valid only: "answered", "awaited", "closed"
- status: string
- Required form-data:
- Required query param:
/ticket/ticket_id/comment- Required query param:
- ticket_id: int
- POST - add commentary to ticket
- Required form-data:
- text: string
- email: string
- Required form-data:
- Required query param:
- Flask - lightweight WSGI web application framework
- Flask-SQLAlchemy - extension for Flask that adds support for SQLAlchemy
- Marshmallow-sqlalchemy - SQLAlchemy integration with the Marshmallow (de)serialization library
- Redis - in-memory data storage and message broker
- uWSGI - service for web-applications hosting
- Docker - Containerized system
This project is licensed under the MIT License - see the LICENSE.md file for details