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
Requirements
- Go 1.22+
- Docker
- Redis
- Make
Installation
-
Clone the repository:
git clone https://github.com/savioruz/roastgithub-api.git
cd roastgithub-api
-
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
-
Run redis:
make docker.redis
-
Run the application:
make docker.run
For production, you need to secure redis on Makefile with a password.
Make
-
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