{"id":19633142,"url":"https://github.com/idoqo/refsys","last_synced_at":"2025-02-26T21:20:37.942Z","repository":{"id":117127150,"uuid":"410961022","full_name":"idoqo/refsys","owner":"idoqo","description":"A sample REST API stimulating a referral system that rewards users based on friend's signups and transactions.","archived":false,"fork":false,"pushed_at":"2021-09-27T16:31:46.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T15:45:10.218Z","etag":null,"topics":[],"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/idoqo.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":"2021-09-27T16:29:35.000Z","updated_at":"2022-01-21T15:47:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3b8e0eb-7574-4b9b-9c38-82db6f9f10fa","html_url":"https://github.com/idoqo/refsys","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoqo%2Frefsys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoqo%2Frefsys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoqo%2Frefsys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoqo%2Frefsys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idoqo","download_url":"https://codeload.github.com/idoqo/refsys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240935464,"owners_count":19881150,"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":"2024-11-11T12:16:23.247Z","updated_at":"2025-02-26T21:20:37.936Z","avatar_url":"https://github.com/idoqo.png","language":"Go","readme":"## Refsys\nReferral system where user earn points for every 3 friends that:\n- uses their referral code to register\n- transfers over 200 points\n\n## Usage\n### Requirements\n- Docker and docker-compose\n- Make (Optional)\n- [Migrate](https://github.com/golang-migrate/migrate) - used to manage the migrations and seeders. Optionally, you can `source` the sql files in the `.sql` directory.\n### App setup\n- Copy the example environment file (`.env.example`) to `.env` i.e.,\n```bash\n$ cp .env.example .env\n```\nand fill the `.env` file with your actual credentials.\n\n- Start the application with:\n```bash\n$ docker-compose up --build\n```\nThis will start the PostgreSQL server on `http://localhost:5432` and the API server on `http://localhost:8000` \n### Database setup/seeding\nThe migration files needed to setup the database are stored in the `sql` folder. Run the make command below to apply them:\n```bash\n$ make migrate-up\n```\nThe command above will:\n- create a users table to store users\n- create a transactions table to store transactions\n- create a wallets table to store user wallet information\n- create a payouts table to store referral payouts that are due.\n- insert a seed transaction for the user with id 1 (since no user would have enough balance to make a transfer initially).\n## API Docs\n### POST /api/register\nSigns up a new user\n#### Request parameters\n- `username=[String]`: Username of the user. Will return an error if the username already exists\n- `password=[String]`: The user's password\n- `referrer=[String]`: Optional. Referral code of the user that referred this user.\n#### Response\n\n### POST /api/transaction\nInitiates a P2P transfer\n#### Request parameters\n- `sender_id=[Number]`: user ID of the sender.\n- `recipient_id=[Number]`: user ID of the recipient\n- `amount=[Number]`: Amount to be transferred. \n- `description=[String]`: Optional. Description of the transaction","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoqo%2Frefsys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidoqo%2Frefsys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoqo%2Frefsys/lists"}