Welcome to the go-rest-api-boilerplate! This project provides a simple way to build a REST API using Go. It includes important features like JWT authentication, PostgreSQL support, and Docker hot-reload. Whether you're looking to create a production-level API or just want to learn Go, this template is for you.
To get the application, visit this page to download: GitHub Releases.
Before you begin, make sure your system meets these requirements:
- Operating System: Windows, macOS, or Linux
- Docker: Installed to run the application smoothly
- PostgreSQL: A version compatible with the application (Check the PostgreSQL website for installation guides)
- Basic Command Line Knowledge: Ability to run commands in your terminal
- Go to the GitHub Releases.
- Find the latest version.
- Click on the downloaded file suitable for your operating system.
After downloading, extract the contents of the ZIP file to a folder on your computer.
- Install PostgreSQL if you haven't done so already.
- Create a new database for your API.
- Update the database connection settings in the application configuration file located in the extracted folder.
-
Open your command line interface.
-
Change to the directory where you extracted the files.
-
Use the following command to start the application:
docker-compose up
-
You should see logs in your terminal indicating your application is running.
Once the application is running, you can access it in your web browser or via tools like Postman. The standard endpoint will be:
http://localhost:8080/api
- JWT Authentication: Secure your API with token-based authentication.
- PostgreSQL Integration: Easily connect your application to a PostgreSQL database.
- Clean Architecture: Follow best practices in structuring your code.
- Docker Support: Quickly run your application in a containerized environment.
- Swagger Documentation: Access automatic API docs for easy reference.
- Tests and CI/CD: Built-in testing features and continuous integration for deployment.
You may want to customize some settings. Look for configuration files in the project folder. Here are key aspects you might adjust:
- Database Configuration: Change database name, user, and password as per your PostgreSQL setup.
- API Ports: Adjust the API listen port in case of conflicts.
- Swagger Settings: Modify documentation details to match your API.
For detailed information on each feature and how to use them, check the documentation folder included in the project. It will guide you through various aspects of this application.
If you're new to Go or API development, consider exploring these learning resources:
- Go Documentation: The official Go site has a wealth of information for beginners.
- REST API Guide: Understanding REST essentials will help you grasp API concepts better.
- Docker Overview: Familiarize yourself with Docker basics for smoother operation.
If you encounter issues or have questions, check the FAQ section in the documentation, or reach out via the project's GitHub Issues page.
Contributions are welcome! If you'd like to submit changes, please refer to the guidelines in the documentation to maintain code quality.
- GitHub Releases - For downloading the latest version.
- PostgreSQL - Official PostgreSQL website for any database-related setups.
- Docker - Get Docker here to run the application easily.
We hope this application helps you kickstart your API development journey!