go-jobs

command module
v0.0.0-...-fd4e3a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 3 Imported by: 0

README ยถ

Go Jobs

The CRUD Project with GORM, PostgreSQL, Gin, Gin-Swagger, Swag, Makefile, Docker, and Docker Compose for study purposes about Go.

Overview

This project implements a CRUD in Go using the following technologies:

On start, this project implements a CRUD in Go using the following technologies:

  • ๐Ÿ—ƒ๏ธ GORM: ORM (Object Relational Mapper) for interacting with the PostgreSQL database.
  • ๐Ÿ˜ PostgreSQL: Relational database used to store CRUD data.
  • ๐ŸŒ Gin: Web framework for building APIs in Go.
  • ๐Ÿ“š Gin-Swagger: Middleware for integrating Swagger with the Gin API.
  • ๐Ÿ“– Swag: Tool for generating Swagger documentation for Go APIs.
  • ๐Ÿ› ๏ธ Makefile: Simplifies common development tasks.
  • ๐Ÿณ Docker: Containerization for isolation and distribution of the application.
  • ๐Ÿšข Docker Compose: Container orchestration for development environments.

Installation

Ensure you have Go, Docker, and Docker Compose installed on your system.

Swag (Swagger) Installation
# Install Swag globally
go get -u github.com/swaggo/swag/cmd/swag

# Add Go's path to your shell (bash or zsh)
export PATH=$PATH:$(go env GOPATH)/bin
export PATH=$PATH:$(go env GOROOT)/bin

Need improvements to auto generate the Swagger documentation on change files inside docker, but for now, you can run the command below to generate the Swagger documentation:

make docs

And up docker compose again.

Locally
# 1. Clone the repository
git clone https://github.com/mnzsss/go-jobs.git

# 2. Navigate to the project directory
cd go-jobs

# 3. Setup the environment variables
cp .env.example .env

# 4. Run the application locally
# By default the application will run on port 8080 with run-with-docs command
make
Docker

Run docker compose with Auto Rebuilding:

# 1. Clone the repository
git clone https://github.com/mnzsss/go-jobs.git

# 2. Navigate to the project directory
cd go-jobs

# 3. Run the application using Docker Compose
docker-compose up

Access the Swagger route in the container: Local Docs

Makefile Tasks

Here are some common tasks you can perform using the Makefile:

  • make run: Run the Go application locally.
  • make run-with-docs: Run the Go application with Swagger documentation.
  • make build: Build the Go application.
  • make test: Run tests for the project.
  • make docs: Generate Swagger documentation for the API.
  • make clean: Clean up generated files and artifacts.

Contributing

Thank you for considering contributing to this project! We welcome contributions from the community to improve and enhance the project. To contribute, please follow the guidelines below:

Issues
  • If you find a bug or have a suggestion, please open an issue.
  • Check if an issue already exists before creating a new one.
Pull Requests
  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-or-fix.
  3. Make your changes and commit them: git commit -m 'Description of changes'.
  4. Push to the branch: git push origin feature-or-fix.
  5. Submit a pull request with a clear title and description.
Coding Standards

Please adhere to the coding standards used in the project. If in doubt, refer to the existing codebase.

Testing

Ensure that your changes do not break existing functionality. If applicable, include new tests for your features.

Documentation

Update the documentation if your changes impact the project's usage or behavior. This includes the README, inline code comments, or any other relevant documentation.

License

By contributing, you agree that your contributions will be licensed under the MIT License.

Thank you for contributing to this project!

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL