{"id":50994760,"url":"https://github.com/istiyakriyad/restaurant-service","last_synced_at":"2026-06-20T08:00:25.723Z","repository":{"id":242772538,"uuid":"810331962","full_name":"IstiyakRiyad/restaurant-service","owner":"IstiyakRiyad","description":"This is a restaurant service application developed in golang. It extract, transform and load the mongodb data to postgresql database. It provide some routes to access the data.","archived":false,"fork":false,"pushed_at":"2024-06-04T21:29:19.000Z","size":20817,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T05:36:42.085Z","etag":null,"topics":["cobra","docker","gin","golang","postgresql","sql","testify"],"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/IstiyakRiyad.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-06-04T13:41:05.000Z","updated_at":"2024-06-06T06:42:19.000Z","dependencies_parsed_at":"2024-06-04T23:25:56.032Z","dependency_job_id":"4e7f72f0-40e1-43be-94e9-be293fd672f0","html_url":"https://github.com/IstiyakRiyad/restaurant-service","commit_stats":null,"previous_names":["istiyakriyad/restaurant-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IstiyakRiyad/restaurant-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IstiyakRiyad%2Frestaurant-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IstiyakRiyad%2Frestaurant-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IstiyakRiyad%2Frestaurant-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IstiyakRiyad%2Frestaurant-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IstiyakRiyad","download_url":"https://codeload.github.com/IstiyakRiyad/restaurant-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IstiyakRiyad%2Frestaurant-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34561766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cobra","docker","gin","golang","postgresql","sql","testify"],"created_at":"2026-06-20T08:00:18.207Z","updated_at":"2026-06-20T08:00:25.709Z","avatar_url":"https://github.com/IstiyakRiyad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eRestaurant Service\u003c/h1\u003e\n  \u003cp\u003e\n    It is a restaurant backend server. Here I try to use Twelve-Factor App Methodology. \n  \u003c/p\u003e\n  \u003cp\u003eSubmitted By: \u003ca href=\"https://github.com/IstiyakRiyad\" target=\"_blank\"\u003eMd. Istiyak Hossain\u003c/a\u003e \u003c/p\u003e\n\u003c/div\u003e\n\n## Prerequisite\nFor manually build the server, install golang \u0026 postgresql locally. Setup the configuration file. Pass the config file with `--config` flag. Default config file `dev.env`\n\n\n### Clone The Repository:\n\n``` bash\n# Download repository:\ngit clone https://github.com/IstiyakRiyad/restaurant-service.git\n\n# Go to parent directory:\ncd restaurant-service\n```\n\n### Menual Build Process:\nPlease put local db config to the .env \u0026 the migrations location on .env file(`MIGRATION_FILE_URL=\"file:///$PROJECT_DIR/migrations\"`). \n``` bash\n# Install dependencies:\ngo mod download\n\n# Build the Project\ngo build -o bin/restaurant\n\n# Setup config file\ncp dev.env .env\n\n# Run migrations\n./bin/restaurant migrate up --config .env\n\n# ETL \n./bin/restaurant etl --config .env\n\n# provide the config file to --config flag\n./bin/restaurant start --config .env\n```\n\n### Docker Process:\n\u003cb\u003eBuild Image Manually:\u003c/b\u003e \u003cbr /\u003e\nFirst clone the repository then enter into the repository. \u003cbr /\u003e\nTo build the just the docker file run:\n``` bash\ndocker build -t istiyak/restaurant .\n```\n\n\u003cb\u003eRun Docker Image Manually:\u003c/b\u003e\u003cbr /\u003e\nHere the docker image take `/app/prod.env` as config file by default. I used `--network host` because my database on the local machine. Please put local db config to the .env \u0026 the migrations location on .env file (`MIGRATION_FILE_URL=\"file:///migrations\"`).\n``` bash\ndocker run --rm -d -v ./.env:/app/prod.env --network host istiyak/restaurant\n```\n\n\u003cb\u003eRun with Docker Compose:\u003c/b\u003e\u003cbr /\u003e\n``` bash\n# copy docker.env to .env \u0026 modify\ncp docker.env .env\n\n# Build\ndocker compose build\n\n# Run docker compose\ndocker compose up -d\n```\n\n\u003cb\u003eETL(Extract, Transform and Load):\u003c/b\u003e \u003cbr /\u003e\nIf you don't load data to the database before then run following command.\n``` bash\ndocker exec restaurant restaurant etl --config /app/prod.env\n```\n\u003cb\u003eTesting:\u003c/b\u003e \u003cbr /\u003e\nI have added some integration testing. \n``` bash\ngo test -cover ./...\n```\n\n## API Documentations:\n* [README API DOCS](https://github.com/IstiyakRiyad/restaurant-service/-/blob/main/docs/README.md)\n* [Insomnia Docs](https://github.com/IstiyakRiyad/restaurant-service/-/blob/main/docs/Insomnia_docs.json)\n\n## Technology:\n\n### Golang Libraries:\n* `gin`\n* `cobra`\n* `viper`\n* `golang-migrate`\n* `pq`\n* `database/sql`\n* `context`\n* `encoding/json`\n* `stretchr/testify`\n\n## Tools\n* `nvim`\n* `air`\n* `Makefile`\n* `docker`\n* `docker compose`\n\n## Project Structure:\n\n* `etl` - code for etl(encoding/jsonextract, transform and load) the given data.\n* `db`  - database connect \u0026 database query files\n* `cmd` - Different command line code.\n* `migrations` - Migration sql files\n* `transport` - HTTP connection functionality code\n* `internal` - Core logic of the application\n* `utils` - Different helper functions\n* `bin` - Binary executable files\n* `restaurantData` - Given json files(restaurant \u0026 user data)\n___\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistiyakriyad%2Frestaurant-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fistiyakriyad%2Frestaurant-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistiyakriyad%2Frestaurant-service/lists"}