Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erismaroliveira/gopportunities
A job opportunities API built using Golang. The API uses Go-Gin as a router, SQLite as a database, and GoORM for database communication. It also includes Swagger for documentation and testing, and a well-organized package structure.
https://github.com/erismaroliveira/gopportunities
api gin go golang goorm rest sqlite swagger
Last synced: about 1 month ago
JSON representation
A job opportunities API built using Golang. The API uses Go-Gin as a router, SQLite as a database, and GoORM for database communication. It also includes Swagger for documentation and testing, and a well-organized package structure.
- Host: GitHub
- URL: https://github.com/erismaroliveira/gopportunities
- Owner: erismaroliveira
- License: mit
- Created: 2023-07-12T02:20:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-08T14:07:44.000Z (over 1 year ago)
- Last Synced: 2024-06-21T15:43:38.865Z (6 months ago)
- Topics: api, gin, go, golang, goorm, rest, sqlite, swagger
- Language: Go
- Homepage:
- Size: 1.13 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GoJob Opportunities API
This project is a modern job opportunities API built using Golang, currently one of the highest paying programming languages. The API is powered by Go-Gin as a router, GoORM for database communication, SQLite as the database, and Swagger for API documentation and testing. The project follows a modern package structure to keep the codebase organized and maintainable.
---
## Features
- Introduction to Golang and building modern APIs
- Development environment setup for creating the API
- Using Go-Gin as a router for route management
- Implementing SQLite as the database for the API
- Using GoORM for communication with the database
- Integrating Swagger for API documentation and testing
- Creating a modern package structure for organizing the project
- Implementing a complete job opportunities API with endpoints for searching, creating, editing, and deleting opportunities
- Implementing automated tests to ensure API quality## Live Version
You can check the documentation and perform tests to the API by visiting the live version hosted at [gopportunities.onrender.com](https://gopportunities.onrender.com/swagger/index.html).
## Installation
To use this project, you need to follow these steps:
1. Clone the repository: `git clone https://github.com/username/repo-name.git`
2. Install the dependencies: `go mod download`
3. Build the application: `go build`
4. Run the application: `./main`## Makefile Commands
The project includes a Makefile to help you manage common tasks more easily. Here's a list of the available commands and a brief description of what they do:
- `make run`: Run the application without generating API documentation.
- `make run-with-docs`: Generate the API documentation using Swag, then run the application.
- `make build`: Build the application and create an executable file named `gopportunities`.
- `make test`: Run tests for all packages in the project.
- `make docs`: Generate the API documentation using Swag.
- `make clean`: Remove the `gopportunities` executable and delete the `./docs` directory.To use these commands, simply type `make` followed by the desired command in your terminal. For example:
```sh
make run
```## Docker and Docker Compose
This project includes a `Dockerfile` and `docker-compose.yml` file for easy containerization and deployment. Here are the most common Docker and Docker Compose commands you may want to use:
- `docker build -t your-image-name .`: Build a Docker image for the project. Replace `your-image-name` with a name for your image.
- `docker run -p 8080:8080 -e PORT=8080 your-image-name`: Run a container based on the built image. Replace `your-image-name` with the name you used when building the image. You can change the port number if necessary.If you want to use Docker Compose, follow these commands:
- `docker compose build`: Build the services defined in the `docker-compose.yml` file.
- `docker compose up`: Run the services defined in the `docker-compose.yml` file.To stop and remove containers, networks, and volumes defined in the `docker-compose.yml` file, run:
```sh
docker-compose down
```For more information on Docker and Docker Compose, refer to the official documentation:
- [Docker](https://docs.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)## Used Tools
This project uses the following tools:
- [Golang](https://golang.org/) for backend development
- [Go-Gin](https://github.com/gin-gonic/gin) for route management
- [GoORM](https://gorm.io/) for database communication
- [SQLite](https://www.sqlite.org/index.html) as the database
- [Swagger](https://swagger.io/) for API documentation and testing## Usage
After the API is running, you can use the Swagger UI to interact with the endpoints for searching, creating, editing, and deleting job opportunities. The API can be accessed at `http://localhost:$PORT/swagger/index.html`.
Default $PORT if not provided=8080.
## Contributing
To contribute to this project, please follow these guidelines:
1. Fork the repository
2. Create a new branch: `git checkout -b feature/your-feature-name`
3. Make your changes and commit them using Conventional Commits
4. Push to the branch: `git push origin feature/your-feature-name`
5. Submit a pull request---
## License
This project is licensed under the MIT License - see the LICENSE.md file for details.
## Credits
This project was created by [Erismar Oliveira](https://github.com/erismaroliveira).