Skip to content

Kubernetes Redis Docker Postgres Golang - KuReDoPoGo, is a backend API service that is built using Golang and Gin Framework. It uses Redis for rate limiting and Postgres for storing data. It is deployed on Kubernetes. For local development it uses Docker Compose.

License

Notifications You must be signed in to change notification settings

Pradumnasaraf/KuReDoPoGo

KuReDoPoGo

Kubernetes Redis Docker Postgres Golang—KuReDoPoGo is a backend API service built using Golang and Gin Framework. It uses Redis for rate limiting and Postgres for storing data. It is deployed on Kubernetes. For local development, it uses Docker Compose.

Using and Developing

Running Locally

Prerequisites

  • Go
  • Postgres (local, remote, or Docker instance)
  • Redis (local, remote, or Docker instance)
  1. Copy the .env.example file to .env and update the values like postgres connection string, redis connection string, and other values as needed. You can use the following command to copy the file:
cp .env.example .env
  1. Install the Go dependencies and run the application:
go mod download
go run main.go

You can access the application at http://localhost:8080.

Running with Docker Compose

Prerequisites

  • Docker
  • Docker Compose
  1. Run the following command to start the application:
docker compose up

If you're using the latest version of Docker Compose, you can leverage the Compose Watch feature. This will automatically rebuild the application when code changes are made:

docker compose up --watch
docker compose up --build --watch

You can access the application at http://localhost:8080 and Postgres at http://localhost:5432.

Using the API

One the application is running, you can use the following endpoints to interact with the API. By default, the rate limit is set to 10 per hour. You can change this in the .env file.

Endpoints

  • GET /users: Get all users
  • GET /users/:id: Get a user by ID
  • POST /users: Create a new user
  • PUT /users/:id: Update a user by ID
  • DELETE /users/:id: Delete a user by ID
  • GET /health: Get the health status of the application

POST and PUT requests require a JSON body with the following structure:

{
  "name": "John Doe",
  "email": "[email protected]"
}

License

This project is licensed under the GNU General Public License v3.0.

Security

If you discover a security vulnerability within this project, please refer to the security policy for more information.

About

Kubernetes Redis Docker Postgres Golang - KuReDoPoGo, is a backend API service that is built using Golang and Gin Framework. It uses Redis for rate limiting and Postgres for storing data. It is deployed on Kubernetes. For local development it uses Docker Compose.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages