{"id":26178838,"url":"https://github.com/bitwise-01/receipt_processor","last_synced_at":"2026-04-23T06:31:41.815Z","repository":{"id":276528021,"uuid":"929427997","full_name":"Bitwise-01/receipt_processor","owner":"Bitwise-01","description":"Receipt Processor is a lightweight API backend built in Go that processes retail receipts to calculate reward points based on a set of business rules. The project is designed using an n‑tier architecture with separate layers for API handling, business logic, persistence, and middleware.","archived":false,"fork":false,"pushed_at":"2025-02-08T19:37:02.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T18:48:00.872Z","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/Bitwise-01.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":"2025-02-08T14:30:22.000Z","updated_at":"2025-02-08T19:37:06.000Z","dependencies_parsed_at":"2025-02-08T20:38:54.471Z","dependency_job_id":null,"html_url":"https://github.com/Bitwise-01/receipt_processor","commit_stats":null,"previous_names":["bitwise-01/receipt_processor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bitwise-01/receipt_processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitwise-01%2Freceipt_processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitwise-01%2Freceipt_processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitwise-01%2Freceipt_processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitwise-01%2Freceipt_processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bitwise-01","download_url":"https://codeload.github.com/Bitwise-01/receipt_processor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitwise-01%2Freceipt_processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32169655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T02:19:40.750Z","status":"ssl_error","status_checked_at":"2026-04-23T02:17:55.737Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2025-03-11T21:42:39.362Z","updated_at":"2026-04-23T06:31:41.799Z","avatar_url":"https://github.com/Bitwise-01.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Receipt Processor\n\nReceipt Processor is a lightweight API backend built in Go that processes retail receipts to calculate reward points based on a set of business rules. The project is designed using an n‑tier architecture with separate layers for API handling, business logic, persistence, and middleware.\n\n## What This Project Does\n\n- **Process Receipts:** Accepts a JSON payload of receipt data, validates it, and calculates reward points according to specific rules (e.g., points per alphanumeric character in the retailer name, bonus points for round totals, etc.).\n- **Retrieve Points:** Provides an endpoint to look up the points awarded for a processed receipt via its unique ID.\n- **Duplicate Prevention:** Uses a hash of the receipt data to prevent storing duplicate receipts.\n- **Rate Limiting:** Implements a sliding window rate limiter (using Redis) to throttle incoming requests.\n- **Logging with Context:** All logs include a unique request ID, making it easier to trace requests through the system.\n\n## Running the Application Using Docker\n\nThis project includes a Dockerfile and a Docker Compose configuration to simplify deployment. The Docker setup creates two services:\n\n- **receipt_processor:** The Go API service.\n- **redis:** A Redis service used for the rate limiter.\n\nTo run the application in Docker, use the following Makefile command:\n\n```bash\nmake docker-run\n```\n\nThis command will:\n\n1. Tear down any existing Docker Compose stack (removing images if necessary).\n2. Build and start the containers in detached mode.\n3. You can then access the API at `http://localhost:8080`\n\n*Warning:* Make sure both ports (8080 and 6379) are not in use.\n\n## Running Tests\n\nThe project includes a comprehensive set of unit and integration tests for the API, middleware, repository, and service layers. To run all tests, use:\n\n```bash\nmake test\n```\n\nFor a test coverage report (which generates a `coverage.out` file and an HTML report), run:\n\n```sh\nmake test-coverage\n```\n\n## Makefile Commands\n\nThe provided Makefile includes the following targets:\n\n1. **test**\n\n    Runs all tests in the project:\n\n    ```sh\n    make test\n    ```\n\n2. **Coverage**\n\n    Runs tests with coverage and generates a coverage HTML report:\n\n    ```sh\n    make test-coverage\n    ```\n\n3. **Run**\n\n    Builds and runs the Docker containers using Docker Compose:\n\n    ```sh\n    make docker-run\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwise-01%2Freceipt_processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwise-01%2Freceipt_processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwise-01%2Freceipt_processor/lists"}