{"id":15095946,"url":"https://github.com/hebertzin/importer","last_synced_at":"2026-02-04T14:04:29.551Z","repository":{"id":249560919,"uuid":"829441960","full_name":"hebertzin/Importer","owner":"hebertzin","description":"A file importer for a database (postgres), proposed by the company enube as a form of technical challenge.","archived":false,"fork":false,"pushed_at":"2025-01-03T15:45:04.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T10:11:41.848Z","etag":null,"topics":["api","design-patterns","docker","docker-hub","gin-gonic","git","github-actions","golang","gorm","postgres","swagger"],"latest_commit_sha":null,"homepage":"https://hebertsanto.github.io/Enube-challenge/","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/hebertzin.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-07-16T12:40:15.000Z","updated_at":"2025-01-03T15:45:08.000Z","dependencies_parsed_at":"2024-08-29T01:26:14.288Z","dependency_job_id":"f8860f12-b2fd-4257-962d-b170fb33bf11","html_url":"https://github.com/hebertzin/Importer","commit_stats":{"total_commits":90,"total_committers":2,"mean_commits":45.0,"dds":0.05555555555555558,"last_synced_commit":"d914cb1e3b7b11b9e0156293838a4e186cafdb0a"},"previous_names":["hebertsanto/enube-challenge","hebertzin/importer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertzin%2FImporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertzin%2FImporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertzin%2FImporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertzin%2FImporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hebertzin","download_url":"https://codeload.github.com/hebertzin/Importer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968916,"owners_count":21191162,"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","design-patterns","docker","docker-hub","gin-gonic","git","github-actions","golang","gorm","postgres","swagger"],"created_at":"2024-09-25T15:44:08.432Z","updated_at":"2026-02-04T14:04:29.439Z","avatar_url":"https://github.com/hebertzin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enube-challenge\n\nEnube-Challenge is a file import application developed in Golang. This project follow good software development practices and features robust functionalities, including user authentication with JWT tokens, CI/CD pipelines for seamless integration, and data management using PostgreSQL. Designed to handle and import supplier data, the application provides endpoints for user authentication, creation and retrieval of user information, and supplier management.\n\n## Techs\n\n* [Golang](https://go.dev/) - Programing language\n* [Gin](https://github.com/gin-gonic/gin) - Gin Web Framework\n* [Docker](https://www.docker.com/) - Containers\n* [Docker hub](https://www.docker.com/) - Deploy Image application\n* [Pipelines](https://docs.github.com/pt/actions) - CI/CD\n* [Postgres](https://www.postgresql.org/) - Database\n* [Jwt](https://www.postgresql.org/) - Token management for application access\n* [Swaggo](https://github.com/swaggo) - Api docs\n* [Railway](https://railway.app/) - Deploy database\n* [Zap](https://github.com/uber-go/zap) - Logs of the application\n* [Postman](https://www.postman.com/) - Testing and documenting APIs.\n\n## **Endpoints**\n\n### Authentication\n- **POST** `/api/v1/authentication/sign-in`: Log in a user and generate a token access\n\n### Users\n\n- **POST** `/api/v1/users/` : Create a new user\n- **GET** `/api/v1/users/:email` : Get a user By email \n\n### Suppliers\n\n- **POST** `/api/v1/suppliers/` : Import all suppliers from a file\n- **GET** `/api/v1/suppliers` : Get all suppliers with pagination\n- **GET** `/api/v1/suppliers/:id` : Get a suppliers by id\n\n## Docs api (Github pages)\n\n[![Texto alternativo](https://github.com/user-attachments/assets/59a1f914-0c72-421a-8a98-91eece7c3c17)](https://hebertsanto.github.io/Enube-challenge/)\n\n\n\n## Running this project\n\n### Environment Setting\n\n1. **Clone the repository**\n\n ```bash\n git clone https://github.com/hebertsanto/Enube-challenge\n cd Enube-challenge\n```\n\n2 **Set the environment variables**\n\n```\nUSER_DATABASE=\"your_user_database\"\nUSER_PASSWORD=\"your_password\"\nDATABASE=\"your_database\"\nPORT=\"port_database\"\nHOST=\"host_databse\"\nSECRET_JWT=\"secret_jwt\"\n```\n\n3 **Install dependencies**\n\n```bash\ngo mod tidy\n```\n\n4 **Run the application**\n\n```bash\ngo run cmd/api/main.go\n```\n\n## Pipeline\n\nThis project includes a pipeline configured to deploy the application to Docker Hub. The pipeline is configured to build and push the Docker image whenever there are changes to the repository.\n\n```dockerfile\n# Use the official Golang image as a parent image\nFROM golang:1.22.0-alpine\n\n# Set the working directory inside the container\nWORKDIR /app\n\n# Copy go.mod and go.sum files and download dependencies\nCOPY go.mod go.sum ./\nRUN go mod download\n\n# Copy the rest of the application code to the container\nCOPY . .\n\n# Build the Go application\nRUN go build -o enube-challenge ./cmd/api/main.go\n\n# Expose port 8080 to the outside world\nEXPOSE 8080\n\n# Define the command to run the application\nCMD [\"./enube-challenge\"]\n\n```\n\nThe entire deployment process is automated with a GitHub Action, streamlining integration and deployment to various services.\n\n## Design patterns\n\n1 [Dependency injection](https://www.freecodecamp.org/news/a-quick-intro-to-dependency-injection-what-it-is-and-when-to-use-it-7578c84fa88f/#:~:text=In%20software%20engineering%2C%20dependency%20injection,be%20used%20(a%20service).)\n\n2 [Dependency inversion](https://medium.com/@tbaragao/solid-d-i-p-dependency-inversion-principle-e87527f8d0be)\n\n3 [Data Transfer Objects](https://docs.abp.io/en/abp/latest/Data-Transfer-Objects)\n\n## Postman collection\n\n- [Click here to postman collection](https://www.postman.com/descent-module-architect-9422719/workspace/enube/collection/36500427-d1489007-cff7-4dd2-8d6f-f869f3c7462d)\n\n## Conclusion\n\nI really enjoyed doing this challenge, I learned a lot of important concepts about the language and new ways of solving problems, it was a great experience.\n\n- Processing xlsx\n  \nIt was a really cool challenge to process this file, I learned several language features, the data was processed in 3 minutes as shown in the image\n  \n![Captura de tela de 2024-07-22 00-46-13](https://github.com/user-attachments/assets/dcaa422c-efe7-4236-b008-74c773b6103b)\n\nIn short, I loved participating in this process, I believe it was very good for my growth and learning.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhebertzin%2Fimporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhebertzin%2Fimporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhebertzin%2Fimporter/lists"}