PowerBase is a high-performance API that provides superhero data with efficient caching and database management. It utilizes Go, Redis, and MySQL to deliver fast and reliable responses.
Features
🚀 Superhero Data API: Retrieve details about various superheroes.
âš¡ High Performance: Uses Redis caching to speed up responses.
🗄 Database-Driven: Stores and fetches data using MySQL.
📡 Pagination & Filtering: Supports limit-based pagination for optimized queries.
🔧 Easy Configuration: Load environment variables from .env.
Installation
Prerequisites
Ensure you have the following installed:
Go 1.20+
MySQL or MariaDB
Redis
Setup
Clone the repository:
git clone https://github.com/AdityaP183/power-base.git
cd power-base
Copy the example environment file:
cp .env.example .env
Edit .env to configure your database and Redis settings.
Install dependencies:
go mod tidy
Run the application:
go run main.go
API Endpoints
Troubleshooting
Database Not Connecting? Ensure MySQL is running and .env is correctly set.
Redis Connection Refused? Start Redis using redis-server or docker run -d -p 6379:6379 redis.
No Data in Response? Run database migrations and insert test data.
Contributing
Pull requests are welcome! Please follow the coding standards and ensure tests pass before submitting.