/GCManager

A Gift Card Management System

Primary LanguagePythonMIT LicenseMIT

GCManager💰💸

A Gift Card Management System

GitHub last commit

A little about the system

Project Structure

.
|-- LICENSE
|-- README.md
|-- codecov.yml
|-- gcmanager
|   |-- __init__.py
|   |-- app.py                 <- Creates the WSGI App with all the settings that's intended to be served.
|   |-- dependencies.py        <- Builds all the dependencies and adds them to the dependency container, ready to be consumed.
|   |-- domain.py              <- All the domain models AKA entities in Clean Architecture are located here.
|   |-- enums.py
|   |-- exceptions.py          <- All the exceptions used within the app are located here.
|   |-- repositories.py        <- All the components that communicate with some sort of external system are located here.
|   |-- routes.py              <- All the API routes defined in the app are present here.
|   |-- serializers.py         <- Models used for (de)serialization of data.
|   |-- settings.py            <- Settings used by the app, all sorts of configuration, secrets and whatnot shall go here.
|   |-- usecases.py            <- The core business logic of the app should be present here.
|   |-- validators.py
|   `-- webapi.py              <- All the Views that map to a URL are located in here.
|-- makefile                   <- Used to run a CI like system locally.
|-- mongo-for-testing.yml      <- MongoDB docker-compose file used for local testing.
|-- poetry.lock
|-- pyproject.toml
`-- tests
    |-- __init__.py
    |-- factories.py
    |-- integration            <- Tests for all the components integrated together.
    |   |-- __init__.py
    |   |-- db_app_test_case.py
    |   |-- test_webapi.py
    |   `-- utils.py
    `-- unit                   <- Tests for a single unit, dependencies are mocked.
        |-- __init__.py
        |-- test_container.py
        |-- test_domain.py
        |-- test_usecases.py
        `-- test_webapi.py

Tests

Run all the quality checks, unit tests and integration tests:

make

Run only unit tests:

python -m unittest discover tests/unit --verbose

Run only integration tests:

python -m unittest discover tests/integration --verbose

Running the project locally:

Run MongoDB using docker-compose:

docker-compose -f mongo-for-testing.yml up -d

Using gunicorn:

gunicorn -w 1 --reload "gcmanager.app:create_app()" -e APP_ENV=TEST

Index

What is this?

This is a gift card management system, made to manage your gift cards in a hassle-free way. Say goodbye to those pesky spreadsheets!

Why is this needed?

I was having a really hard time managing my gift card collection in a spreadsheet, I always needed to fill in all the information by hand like the date of purchase, denomination, source etc. and honestly it never felt intuitive to me and was becoming a lot of work that was hard to maintain.

What does it solve?

It aims to provide an intuitive way of adding a gift card to your asset collection & retrieve them as and when needed.

Who is this intended for?

GCManager can be used by anyone who believe that managing their gift cards is becoming a PITA, and they wouldn't want to waste their time anymore.

Caveats

  • This application was made keeping AMAZON brand in mind, but can be used for other brands that use PIN & Redeem Code.