Skip to content

IzmdI/ticket-system

Repository files navigation

Ticket system

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.

Before Started

You will need Docker to run it. Install last version depending from your OS. After installation just clone this repository.

Starting

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
  • /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"
  • /ticket/ticket_id/comment
    • Required query param:
      • ticket_id: int
    • POST - add commentary to ticket
      • Required form-data:
        • text: string
        • email: string

Built With

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Simple API ticket system, based on Flask.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published