{"id":18046973,"url":"https://github.com/vyom-yadav/github-gist-clone-backend","last_synced_at":"2025-04-10T04:55:50.131Z","repository":{"id":162151284,"uuid":"636754371","full_name":"Vyom-Yadav/GitHub-Gist-Clone-Backend","owner":"Vyom-Yadav","description":"Backend REST API for GitHub Gist Clone","archived":false,"fork":false,"pushed_at":"2023-11-02T08:33:52.000Z","size":203,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:11:28.898Z","etag":null,"topics":["api-rest","clone-app","database","golang","postgres"],"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/Vyom-Yadav.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}},"created_at":"2023-05-05T15:05:47.000Z","updated_at":"2023-10-31T19:15:47.000Z","dependencies_parsed_at":"2023-10-31T20:25:58.623Z","dependency_job_id":null,"html_url":"https://github.com/Vyom-Yadav/GitHub-Gist-Clone-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/Vyom-Yadav%2FGitHub-Gist-Clone-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vyom-Yadav%2FGitHub-Gist-Clone-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vyom-Yadav%2FGitHub-Gist-Clone-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vyom-Yadav%2FGitHub-Gist-Clone-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vyom-Yadav","download_url":"https://codeload.github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161257,"owners_count":21057554,"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":["api-rest","clone-app","database","golang","postgres"],"created_at":"2024-10-30T19:09:59.324Z","updated_at":"2025-04-10T04:55:50.104Z","avatar_url":"https://github.com/Vyom-Yadav.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Gist Clone Backend\n\n[![Go Build And Test](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/actions/workflows/go.yml/badge.svg)](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/actions/workflows/go.yml)\n[![Docker Image CI](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/actions/workflows/docker-registry-build-and-push.yaml/badge.svg)](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/actions/workflows/docker-registry-build-and-push.yaml)\n\nBackend REST API for GitHub Gist Clone built using Golang, Gin, GORM, Docker, and PostgreSQL and [other awesome Go libraries](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/blob/master/go.mod).\n\n## Running\n\n### Pre-requisites\n\nApart from regular tools like Docker, Docker Compose, Go, etc. you will need following files to run the project:\n\n1. `./app.env` - Environment variables for the application (Example)\n\n```properties\nPOSTGRES_HOST=postgres\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=password123\nPOSTGRES_DB=gist-backend\nPOSTGRES_PORT=5432\n\nPORT=8000\n\n# Required for CORS\nCLIENT_ORIGIN=http://localhost:3000\n\nACCESS_TOKEN_PRIVATE_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01CZUgKSlk5TUJLUEMzVHdQQVdwcSswL3p3UmE2ZkZtbXQ5NXNrN21qT3czRzNEZ3M5T2RTeWdsbTlVdndNWXh6SXFERAplUUloQVA5UStrMTBQbGxNd2ZJbDZtdjdTMFRYOGJDUlRaZVI1ZFZZb3FTeW40YmpBaUVBaHVUa2JtZ1NobFlZCnRyclNWZjN0QWZJcWNVUjZ3aDdMOXR5MVlvalZVRlVDSUhzOENlVHkwOWxrbkVTV0dvV09ZUEZVemhyc3Q2Z08KU3dKa2F2VFdKdndEQWlBdWhnVU8yeEFBaXZNdEdwUHVtb3hDam8zNjBMNXg4d012bWdGcEFYNW9uUUlnQzEvSwpNWG1heWtsaFRDeWtXRnpHMHBMWVdkNGRGdTI5M1M2ZUxJUlNIS009Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t\nREFRESH_TOKEN_PUBLIC_KEY=LS0tLS1CRUdJTiBQVUJMSUMgUUFEU3dBd1NBSkJBSWFJcXZXe2F5Rwo1WTBpRnBudWtCdVR6UWVZUFpBOGx4OC9lTUh3Rys1MlJGR3VxMmE2N084d2s3TDR5dnY5dVY4Q0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==\nREFRESH_TOKEN_EXPIRED_IN=60m\nREFRESH_TOKEN_MAXAGE=60\n\nEMAIL_FROM=no-reply@github-gist.com\nSMTP_HOST=sandbox.smtp.mailtrap.io\nSMTP_USER=87b94787\nSMTP_PASS=0216\nSMTP_PORT=2525\n\nGITHUB_CLIENT_ID=7a9ffc39\nGITHUB_CLIENT_SECRET=3103c12b92\n\nAPP_ENV=development\n```\n`ACCESS_TOKEN_MAXAGE` - Time in minutes\n\n`REFRESH_TOKEN_MAXAGE` - Time in minutes\n\n`APP_ENV` - `development` or `production`\n\n2. `./pgadmin.env` - PostgreSQL admin credentials (Example)\n\n```properties\nPGADMIN_DEFAULT_EMAIL=user@domain.com\nPGADMIN_DEFAULT_PASSWORD=SuperSecret\n```\n\n**Note:** Modifying any of the above files might require you to change port numbers, etc. in the [`docker-compose.yml`](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/blob/master/docker-compose.yaml) file.\n\n### Starting the application\n\n```bash\n$ docker-compose up -d\n```\n\nThe REST API is documented using swagger and can be accessed at http://localhost:8000/swagger/index.html (`8000` Port Number)\n\nThe docs are also checked into the repository and can be accessed at `./docs/`\n\n### Stopping the application\n\n```bash\n$ docker-compose down\n```\n\n## Modifying the application\n\nAfter modifying the Go source code, you can rebuild the application using the following command:\n\n```bash\n$ docker build -t yvyom/github-gist-backend:v1.0-alpha .\n```\n\nYou can either use a different tag or remove the older image and use `pull_policy: if_not_present` in the [`docker-compose.yml`](https://github.com/Vyom-Yadav/GitHub-Gist-Clone-Backend/blob/master/docker-compose.yaml) file to pull the latest image.\n\n## Directory Structure\n\n```bash\n.\n├── app.env             # Application environment variables\n├── controllers         # Application controllers\n├── docker-compose.yaml # Docker compose file\n├── Dockerfile          # Dockerfile for building the application\n├── docs                # Swagger docs\n├── go.mod              # Go module file\n├── go.sum              # Go sum file\n├── initializers        # Application initializers (Connecting to DB, Loading Env Files, etc.)\n├── main.go             # Main file\n├── middleware          # Application middleware (Checking if user is authenticated (DeserializeUser), etc.)\n├── models              # Application models\n├── pgadmin.env         # PostgreSQL admin credentials\n├── README.md           # README file\n├── routes              # Application routes\n├── scripts             # Scripts for running the application (enabling uuid-ossp on database for uuid generation)\n├── templates           # Application templates (for sending emails)\n├── hack                # Scripts for building and pushing the docker image\n└── utils               # Application utilities (for sending emails, generating tokens, etc.)\n```\n\nView documentation locally using swagger or in markdown (using converter) [here](/SWAGGER-TO-MARKDOWN.md).\n\n## Contributing to this project\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\nBe Respectful and Kind to each other. We are all here to learn and grow together.\n\n# Give a ⭐️ if you like this project!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyom-yadav%2Fgithub-gist-clone-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvyom-yadav%2Fgithub-gist-clone-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyom-yadav%2Fgithub-gist-clone-backend/lists"}