{"id":25254535,"url":"https://github.com/edmartt/loyalty-system","last_synced_at":"2025-04-05T23:14:38.540Z","repository":{"id":274142710,"uuid":"865431768","full_name":"Edmartt/loyalty-system","owner":"Edmartt","description":"reward system to incentivize customer loyalty.","archived":false,"fork":false,"pushed_at":"2024-12-12T00:31:49.000Z","size":863,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-12T05:42:18.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edmartt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-30T14:18:26.000Z","updated_at":"2024-10-12T06:54:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f36c9508-19b9-4240-a724-1ddf24414ac7","html_url":"https://github.com/Edmartt/loyalty-system","commit_stats":null,"previous_names":["edmartt/loyalty-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Floyalty-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Floyalty-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Floyalty-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Floyalty-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edmartt","download_url":"https://codeload.github.com/Edmartt/loyalty-system/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411238,"owners_count":20934654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-12T05:32:28.408Z","updated_at":"2025-04-05T23:14:38.526Z","avatar_url":"https://github.com/Edmartt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loyalty-System\n\nLoyalty system is a system that implements a solution for the following requirements\n\n- Hexagonal Architecture\n\n- Set campaigns for a store and branches.\n\n- Query campaigns for a store and branches.\n\n- Accumulate points or cashback if the store and branch has a campaign configured.\n \n- Redeem points or cashback in a store.\n\n\n## Project Structure\n\n![](https://github.com/Edmartt/loyalty-system/blob/dev/assets/structure.png)\n\n## ER Diagram\n\n![](https://github.com/Edmartt/loyalty-system/blob/dev/assets/schemeER.png)\n\n## Requirements\n\n- Go 1.19+\n- SQLite\n- http client: POSTMAN, Insomnia, cURL\n\n### Running Locally\n\n```\ngit clone https://github.com/Edmartt/loyalty-system.git\n```\n\nor ssh instead:\n\n```\ngit clone git@github.com:Edmartt/loyalty-system.git\n```\n\nbrowse into project directory:\n\n```\ncd loyalty-system/\n```\n\ndownload dependencies\n\n```\ngo mod tidy\n```\n\ninstall tool for migrations\n\n```\ngo install github.com/rubenv/sql-migrate/...@latest\n```\n\nset environment variables following the [.env.example](https://github.com/Edmartt/loyalty-system/blob/dev/.env.example) file for go specific use and run\n\nset environment variables following the [.envrc.example](https://github.com/Edmartt/loyalty-system/blob/dev/.envrc.example) file for migrations config [dbconfig.yml](https://github.com/Edmartt/loyalty-system/blob/dev/dbconfig.yml)\n\n### making migrations\n\n1. create database for the system (do this in your postgres instance)\n\n2. check migrations status. This will load the [migrations/postgres](https://github.com/loyalty-system/blob/dev/migrations/postgres/) files and it will show if migrations are applied or no.\n\n![](https://github.com/Edmartt/loyalty-system/blob/dev/assets/status.png)\n\n```\nsql-migrate status\n```\n\n3. Apply migrations after checking status\n\n```\nsql-migrate up\n```\n\n#### note\n\nthe above command will apply the migrations in chronological order based on the timestamp. If you want to apply only a specific version you must use the -version flag as follows:\n\n```\nsql-migrate up -version 20240929193601\n```\n\n4. Run the project\n\n```\ngo run cmd/main.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Floyalty-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedmartt%2Floyalty-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Floyalty-system/lists"}