{"id":37141805,"url":"https://github.com/abdelrahman146/digital-wallet","last_synced_at":"2026-01-14T16:38:35.842Z","repository":{"id":256103755,"uuid":"849748734","full_name":"abdelrahman146/digital-wallet","owner":"abdelrahman146","description":"Proof of Concept for a digital wallet system","archived":false,"fork":false,"pushed_at":"2024-09-26T03:04:54.000Z","size":339,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-15T05:11:46.753Z","etag":null,"topics":["digital-wallet","golang","loyalty","postgresql","store-credit"],"latest_commit_sha":null,"homepage":"","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/abdelrahman146.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-08-30T07:05:59.000Z","updated_at":"2024-09-26T03:04:58.000Z","dependencies_parsed_at":"2024-09-17T19:11:29.076Z","dependency_job_id":null,"html_url":"https://github.com/abdelrahman146/digital-wallet","commit_stats":null,"previous_names":["abdelrahman146/digital-wallet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abdelrahman146/digital-wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahman146%2Fdigital-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahman146%2Fdigital-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahman146%2Fdigital-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahman146%2Fdigital-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdelrahman146","download_url":"https://codeload.github.com/abdelrahman146/digital-wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahman146%2Fdigital-wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:32:27.303Z","status":"ssl_error","status_checked_at":"2026-01-14T16:28:36.419Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["digital-wallet","golang","loyalty","postgresql","store-credit"],"created_at":"2026-01-14T16:38:35.171Z","updated_at":"2026-01-14T16:38:35.828Z","avatar_url":"https://github.com/abdelrahman146.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digital Wallet\nThis is a Proof of Concept for a digital wallet system. The system is built using Go and PostgreSQL.\nThe system lets you create multiple wallets (e.g. Store Credit, Loyalty Points, Credit line Wallet, Payouts Wallet...etc.)\nEach user can have an account in each wallet and can perform transactions (DEBIT/CREDIT) on the account. The account holds the balance of the user in the wallet.\nThe system also supports multiple user tiers (e.g. basic, premium, enterprise) and each tier can have different limits on the wallet balance and different exchange rates between the wallets.\nThe system also supports automating reward programs by making event based rule based engine that can trigger transactions based on the events.\n\n```mermaid\ngraph TD\n    U[User] --\u003e|Belongs to| TI1(Gold Tier)\n    U[User] --\u003e|Owns| A1(Account1)\n    U[User] --\u003e|Owns| A2(Account2)\n    subgraph AED\n        A1(Account1) --\u003e|DEBIT| T1(Transaction1)\n        A1(Account1) --\u003e|CREDIT| T2(Transaction2)\n    end\n    subgraph LOYALTY\n        A2(Account2) --\u003e|DEBIT| T3(Transaction3)\n        A2(Account2) --\u003e|CREDIT| T4(Transaction4)\n    end\n```\n\nYou can see the ERD of the system in the `docs/ERD.md` file. and system design in the `docs/system-design.md` file.\n\n\n## Setup\n\nClone the repository\n\n```\ngit clone https://github.com/abdelrahman146/digital-wallet.git\n```\n\nChange the directory\n\n```\ncd digital-wallet\n```\n\nInstall the dependencies\n\n```\ngo mod tidy\n```\n\nCreate a `.env` by copying the `.env.example` file\n\n```\ncp .env.example .env\n```\n\nMake sure you have a running PostgreSQL server and update the `.env` file with your database credentials\nRun the migrations\n\ninstall the migrate tool\n```\ncurl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$os-$arch.tar.gz | tar xvz\n```\n\n```\nmake migrate-up\n```\n\nCopy the content inside docs/swagger.yaml\nOpen postman and click on import and paste the content\nYou can now a colleaction of all the endpoints\nRun the server\n\n```\nmake dev\n```\n\nThe server will be running on `http://localhost:3401`\n\n## API Documentation\n\nThe API documentation is available at `http://localhost:3401/swagger/index.html`\n\n## How to try the project\n\nYou can try the project by using the postman collection and the API documentation\n\n1. You can create different users by using the `POST /api/v1/backoffice/users` endpoint\n2. You can create user tiers such as `basic`, `premium`, and `enterprise` by using the `POST /api/v1/backoffice/tiers`\n   endpoint\n2. You can then create multiple wallets by using the `POST /api/v1/backoffice/wallets` endpoint\n3. You can then create users accounts in each wallet by using the `POST /api/v1/backoffice/accounts` endpoint\n4. You can then create transactions (DEBIT/CREDIT) the accounts by using\n   the `POST /api/v1/backoffice/wallet/{walletId}/transactions` endpoint.\n5. You can then get the balance of the account by using\n   the `GET /api/v1/backoffice/wallet/{walletId}/accounts/{account_id}` endpoint\n\nThere are many other endpoints that you can try in the postman collection. You can also check the API documentation for\nmore information.\nOne interesting endpoint is the `POST /api/v1/backoffice/wallet/{walletId}/check-integrity` endpoint which checks the\nintegrity of the wallet by calculating the sum of all the wallet accounts and the sum of the transactions and the diff\nshould 0.\n\n## Check List\n- [x] Wallets\n- [x] Tiers\n- [x] Users \u0026 Accounts\n- [x] Transactions / Exchange / Points Expiry\n- [x] Audit and Integrity Check\n- [x] Triggers\n- [x] Programs\n- [ ] User API\n- [x] Tests\n- [ ] reverse a transaction by providing some metadata value to match which transaction to reverse.\n\n## To Generate Mocks \n```\ngo install go.uber.org/mock/mockgen@latest\n```\nthen run the following command\n```\nmake gen-mocks\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahman146%2Fdigital-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdelrahman146%2Fdigital-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahman146%2Fdigital-wallet/lists"}