Skip to content

AlanFoster/ticket-management-graphql-eventsourcing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticket Management

Create, Edit, Delete, Duplicate tickets and view ticket history in a simple ticket management system - all managed by the concepts of event sourcing.

Overview

Running

First ensure that you have your .env file set up with the correct environment variables:

cp .env.example .env

Running the containers:

docker-compose build
docker-compose up

Once running - in a new tab ensure that the database migrations have been applied:

docker-compose exec backend flask db upgrade

The following endpoints should now be available on your host machine:

Postgres will be available on the host machine on port 5510.

Backend Dev

The following technologies are used for the backend:

  • Graphene + Flask - Used to build GraphQL API in Python
  • Eventsourcing - The heart of the API which tracks all state changes via domain events, and provides the means to reconstruct the application state either on demand, via snapshots, or projections
  • SqlAlchemy + Flask Migrate - Database ORM and migration support

The development flow consists of running the docker containers with docker-compose up. Any changes to the backend/ folder will cause an automatic reload of flask.

It is also possible to start a new shell into the backend process with:

docker-compose up
docker-compose exec backend /bin/sh

Running tests:

docker-compose up
docker-compose exec backend /bin/sh
pytest

Migrations

To create migration scripts, ensure that you have added/upgraded your SqlAchemy db models then create a new migration with:

flask db migrate -m "add event sourcing table"

To apply changes to your database:

flask db upgrade

Frontend Dev

The following technologies are used for the frontend:

  • React - View layer
  • material-ui - React components for faster and easier web development
  • Next.JS - Server side rendering for React
  • Apollo - GraphQL client with React integration

Running tests:

docker-compose up
docker-compose exec frontend /bin/sh
yarn test

For generating the latest TypeScript definitions for GraphQL queries:

yarn codegen:watch

Downloading the latest schema from the backend:

yarn schema:fetch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published