roastgithub-api

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

RoastGitHub API

RoastGitHub API is a service that interacts with GitHub to fetch user profiles, repositories, and README files, then generates humorous or insightful content using the Gemini AI model.

Table of Contents

Features

  • Fetch GitHub user profiles and repositories.
  • Auto-detect language based on user location or manual input (currently id or en).
  • Generate content using Google’s Gemini AI model.

Deployment

  • Koyeb

Deploy to Koyeb

  • Railway

Deploy on Railway

  • Render

Deploy to Render

Requirements

  • Go 1.22+
  • Docker
  • Redis
  • Make

Installation

  1. Clone the repository:

    git clone https://github.com/savioruz/roastgithub-api.git
    cd roastgithub-api
    
  2. Environment Variables:

    Create a .env file in the root directory and add the following:

    cp .env.example .env
    

Usage

Running the API

You can run the API using Docker or directly with Make.

Docker
  1. Run redis:

    make docker.redis
    
  2. Run the application:

    make docker.run
    

For production, you need to secure redis on Makefile with a password.

Make
  1. Run the application:

    make run
    

You need to have Redis running on your machine.

API Documentation

Swagger documentation is available at: http://localhost:3000/swagger.

Project Structure

.
├── app/
│   ├── handlers/        # HTTP handler functions
│   └── models/          # Data structures and models
├── docs/                # Documentation files
├── pkg/
│   ├── middleware/      # Middleware functions for request handling
│   ├── repository/      # Data access layer
│   ├── routes/          # API route definitions
│   └── utils/           # Utility functions including GitHub and Gemini services
└── platform/
    └── cache/           # Redis caching implementation

Contributing

Feel free to open issues or submit pull requests with improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Reference

Inspired by the roastgithub project.

Acknowledgements

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
pkg
platform

Jump to

Keyboard shortcuts

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