Enube-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.
- Golang - Programing language
- Gin - Gin Web Framework
- Docker - Containers
- Docker hub - Deploy Image application
- Pipelines - CI/CD
- Postgres - Database
- Jwt - Token management for application access
- Swaggo - Api docs
- Railway - Deploy database
- Zap - Logs of the application
- Postman - Testing and documenting APIs.
- POST
/api/v1/authentication/sign-in
: Log in a user and generate a token access
- POST
/api/v1/users/
: Create a new user - GET
/api/v1/users/:email
: Get a user By email
- POST
/api/v1/suppliers/
: Import all suppliers from a file - GET
/api/v1/suppliers
: Get all suppliers with pagination - GET
/api/v1/suppliers/:id
: Get a suppliers by id
- Clone the repository
git clone https://github.com/hebertsanto/Enube-challenge
cd Enube-challenge
2 Set the environment variables
USER_DATABASE="your_user_database"
USER_PASSWORD="your_password"
DATABASE="your_database"
PORT="port_database"
HOST="host_databse"
SECRET_JWT="secret_jwt"
3 Install dependencies
go mod tidy
4 Run the application
go run cmd/api/main.go
This 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.
# Use the official Golang image as a parent image
FROM golang:1.22.0-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the application code to the container
COPY . .
# Build the Go application
RUN go build -o enube-challenge ./cmd/api/main.go
# Expose port 8080 to the outside world
EXPOSE 8080
# Define the command to run the application
CMD ["./enube-challenge"]
The entire deployment process is automated with a GitHub Action, streamlining integration and deployment to various services.
I 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.
- Processing xlsx
It 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
In short, I loved participating in this process, I believe it was very good for my growth and learning.