{"id":20393748,"url":"https://github.com/luanroger/coupontake","last_synced_at":"2026-03-05T06:31:27.743Z","repository":{"id":110440498,"uuid":"588543693","full_name":"LuanRoger/CouponTake","owner":"LuanRoger","description":"A complete solution to redeem random codes from a web API, the back-end was made in ASP.NET and the front-end in Flutter.","archived":false,"fork":false,"pushed_at":"2023-01-24T11:32:17.000Z","size":7664,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T01:33:14.564Z","etag":null,"topics":["asp-net","docker","docker-compose","flutter","learn","material-ui","responsive","rest-api","website"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/LuanRoger.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":"2023-01-13T11:31:01.000Z","updated_at":"2024-09-18T09:17:18.000Z","dependencies_parsed_at":"2023-04-10T14:48:08.826Z","dependency_job_id":null,"html_url":"https://github.com/LuanRoger/CouponTake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LuanRoger/CouponTake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuanRoger%2FCouponTake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuanRoger%2FCouponTake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuanRoger%2FCouponTake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuanRoger%2FCouponTake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuanRoger","download_url":"https://codeload.github.com/LuanRoger/CouponTake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuanRoger%2FCouponTake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30112226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["asp-net","docker","docker-compose","flutter","learn","material-ui","responsive","rest-api","website"],"created_at":"2024-11-15T03:49:51.545Z","updated_at":"2026-03-05T06:31:27.729Z","avatar_url":"https://github.com/LuanRoger.png","language":"Dart","readme":"# Coupon Take\nA complete solution to redeem random codes from a web API, the back-end was made in ASP.NET and the front-end in Flutter.\n\n## Techs\n- Flutter\n- ASP.NET\n  - Ocelot\n  - JWT\n  - Argon2\n- EntityFramework\n- Docker\n- Postgres\n\n## Setup\nYou will need Docker, Docker Compose and OpenSSL to setup and run the project.\nFlutter will be used to build the project for web, there is no good Flutter image to get the job done, so we ganna do by own. If you are running in a enviroment that don't have Flutter and don't want to install you can just skip the [step](https://github.com/LuanRoger/CouponTake#build-the-flutter-project-for-the-web), on the [actions](https://github.com/LuanRoger/CouponTake/actions) tab you will find project builds that you can just download, but is highly recommended that you build by your self.\n[![Flutter Web build](https://github.com/LuanRoger/CouponTake/actions/workflows/flutter_web_build.yml/badge.svg?branch=main)](https://github.com/LuanRoger/CouponTake/actions/workflows/flutter_web_build.yml)\n\nThe Docker will be used to build the images and run the containers and the Docker Composer is to create a cluster with all APIs and services running on.\nThe OpenSSL is just to create the RSA keys used by ```CouponTakeInfra.Auth``` to sign the JWTs.\n\n### Clone the repository\n```bash\ngit clone https://github.com/LuanRoger/CouponTake.git\ncd CouponTake\n```\n\n### Build the Flutter project for the web\n```bash\nflutter build web --release\n```\n\u003e NOTE: At the actual moment is preferable that the project is builded by Flutter in the **beta** channel, because some widget is not themed for Material 3 in the stable channel.\n\n### Create the the certificates\nFirs create the path to store the public and private key that will be used to sign the JWTs.\nCreate a folder called ```certificates``` on the ```CouponTake/CouponTakeInfra/``` path:\n```bash\nmkdir CouponTakeInfra/certificates\ncd CouponTakeInfra/certificates\n```\nCreate the both public and private RSA key from thre:\n```bash\nopenssl genrsa -out jwt-auth-priv-key.pem 4096\nopenssl rsa -in jwt-auth-priv-key.pem -pubout -out jwt-auth-pub-key.pem\n```\nThose keys will be copied to the container.\n\n### Build\nBefore build check the .env file and change if needed.\nBack to the root of the project (```/CouponTake```), build and start all the services with Docker Compose:\n```bash\ndocker-compose up -d\n# OR\ndocker compose up -d\n```\nThere is a Dockerfile for each service used by ```docker-compose.yaml``` and you can build and run just what you want.\n```bash\ndocker build -t \u003ctag\u003e -f \u003cDockerfile\u003e .\n```\n\u003e Enter with the tag name that you prefer\n\n### Dockerfiles\n- CouponTake (front-end): ```CouponTake/Dockerfile```\n- CouponTakeInfra.Gateway: ```CouponTake/CouponTakeInfra/Auth.Dockerfile```\n- CouponTakeInfra.Auth: ```CouponTake/CouponTakeInfra/Gateway.Dockerfile```\n- CouponTakeInfra.CouponGeneration: ```CouponTake/CouponTakeInfra/CouponGeneration.Dockerfile```\n\nIf you choose to build and run each Dockerfile by own, keep in mind that you will need to pull the [Postgres image from DockerHub](https://hub.docker.com/_/postgres)\n\n## Projects overview\n**CouponTake (front-end/root)** is the UI to communicate with the APIs/infrastructure, and the entrypoint for it is the **CouponTakeInfra.Gateway** that uses [Ocelot](https://github.com/ThreeMammals/Ocelot) to redirect the request to the right service.\n\nOne of them is **CouponTakeInfra.Auth** responsable to login and sign a user, it uses JWT to authorize the request. He also use Argon2 to to encript the user's password to store into Postgres.\nThe last one is the **CouponTakeInfra.CouponGeneration**, this service just create a new coupon code (aka GUID lol) and get informations from the database about it.\n```mermaid\ngraph LR;\n    front([CouponTake])--\u003eCouponTake.Gateway;\n    CouponTake.Gateway--\u003eCouponTake.Auth;\n    CouponTake.Gateway--\u003eCouponTake.CouponGeneration;\n    CouponTake.CouponGeneration--\u003edb[(PostgresDB)];\n    CouponTake.Auth--\u003edb[(PostgresDB)];\n```\n\n## Screenshots\n| Screenshot                                                                           |\n|--------------------------------------------------------------------------------------|\n![](https://github.com/LuanRoger/CouponTake/blob/main/screenshots/home_light.png)\n![](https://github.com/LuanRoger/CouponTake/blob/main/screenshots/home_dark.png)\n![](https://github.com/LuanRoger/CouponTake/blob/main/screenshots/home_dark_red.png)\n![](https://github.com/LuanRoger/CouponTake/blob/main/screenshots/home_dark_yellow.png)\n\n## ☁️ Deploy\nYou can easily deploy this project at DigitalOcean.\n\n[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=dddd7d890760\u0026utm_campaign=Referral_Invite\u0026utm_medium=Referral_Program\u0026utm_source=badge)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluanroger%2Fcoupontake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluanroger%2Fcoupontake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluanroger%2Fcoupontake/lists"}