{"id":18083179,"url":"https://github.com/dusansimic/receipts-archive-backend","last_synced_at":"2025-04-05T23:14:59.876Z","repository":{"id":103982528,"uuid":"256035670","full_name":"dusansimic/receipts-archive-backend","owner":"dusansimic","description":"Backend for Receipts Archive web app.","archived":false,"fork":false,"pushed_at":"2020-07-05T15:41:13.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T05:39:22.118Z","etag":null,"topics":["backend","golang","receipts","stats"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dusansimic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-04-15T21:00:21.000Z","updated_at":"2020-07-05T15:41:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"01d67688-4b44-4a61-87af-e9a591d82a8c","html_url":"https://github.com/dusansimic/receipts-archive-backend","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/dusansimic%2Freceipts-archive-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusansimic%2Freceipts-archive-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusansimic%2Freceipts-archive-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dusansimic%2Freceipts-archive-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dusansimic","download_url":"https://codeload.github.com/dusansimic/receipts-archive-backend/tar.gz/refs/heads/master","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":["backend","golang","receipts","stats"],"created_at":"2024-10-31T14:07:08.923Z","updated_at":"2025-04-05T23:14:59.846Z","avatar_url":"https://github.com/dusansimic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Receipts Archive Backend\n\nBacked for Receipts Archive written in Go. This is a work in progress and project that I use to learn more about full stack development and deployment and fix everyday problems that I have.\n\nGoal is to have an web app that would be used for storing receipts from grocery shopping and see stats about what items are bought the most, where are they bought, how much do they cost and other useful stuff.\n\nIt's written in Go so it's very easy to deploy it with Docker or other containerized environments.\n\n## Build\n\nThis is worked on and tested on a Linux machine so these instructions are confirmed to work for Linux.\n\nTo install all dependencies run\n```sh\n$ go mod download\n```\n\nand build the backend run\n```sh\n$ go build -o main\n```\n\n## Run\n\nYou'll need to set environment variables before running the backend. You can use `.env` file to store environment variables without specifying them on every execution of the backend.\n\nHere is the list of environment variables and their description.\n\n|Environment variable|Description|\n|-|-|\n|SESSION_COOKIE_SECRET|Secret for the session cookie|\n|GOTHIC_COOKIE_SECRET|Secret for the Gothic cookie (3rd party service OAuth)|\n|GOOGLE_OAUTH_CLIENT_KEY|Client id for Google oauth|\n|GOOGLE_OAUTH_CLIENT_SECRET|Client secret for Google auth|\n|GOOGLE_OAUTH_CALLBACK_URL|Callback url for oauth on the backend (use localhost if in dev mode)|\n|AUTH_CALLBACK|Callback url to the frontend after authentication is finished (use localhost if in dev mode)|\n|ALLOW_ORIGINS|Allowed origins (use localhost if in dev mode)|\n|SESSION_STORE_DATABASE_ADDRESS|Address of the Memcached database used for storing session data|\n|PORT|Port on which server will listen for requests|\n\nTo run the backend just run the built binary\n```sh\n$ ./main\n```\n\nThe SQLite database will be automatically generated when running the backend for the first time.\n\n### Docker\n\nYou can also run this backend inside a docker container. Just pull the image and run it with this command.\n\n```sh\n$ docker pull dusansimic/receipts-archive-backend\n$ docker run -e ... dusansimic/receipts-archive-backend\n```\n\nOther options is to use `.env` file with the following command.\n\n```sh\n$ docker run --env-file .env dusansimic/receipts-archive-backend\n```\n\n## Deployment\n\nIf you want to deploy this with frontend, you should check [this](https://gitlab.com/makerns/receipts-archive/deployment) out.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusansimic%2Freceipts-archive-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdusansimic%2Freceipts-archive-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusansimic%2Freceipts-archive-backend/lists"}