- Giphy API Integration: Fetch GIFs based on search terms.
- Response Formatting: Support for JSON, XML, and Protobuf formats.
- API Key Management: Create and delete API keys using SQLite.
- Endpoints:
/giphy: Fetch GIFs using the Giphy API./api-key(POST/DELETE): Manage API keys.
- Authentication: API key-based authentication using middleware.
- Caching: Caching using
redisfor a faster response time when querying the same thing.
- **Containerization**: Docker support with Docker Compose for easy setup.
-
GET /giphy- Query Params:
q: Search term for GIFs.o: (Optional) Response format -json,xml, orprotobuf.
- Response: GIFs matching the search query in the requested format.
- Query Params:
-
POST /api-key- Description: Create a new API key.
- Response: Returns the newly created API key.
-
DELETE /api-key- Description: Delete an existing API key.
- Parameters:
/api-key/:id - Response: Confirmation of deletion.
- Clone the Repository
git clone git@github.com:zokhcat/giphyscraper.git cd giphyscraper - Configure Giphy API Key
GIPHY_API_KEY=<your-api-key> docker compose upService will be available at http://localhost:8080.
The API uses a middleware to validate API keys for /giphy route
- Golang
- SQLite for API key storage
- Redis for caching
- Docker & Docker Compose for containerization
- Giphy API integration
- Setup Giphy API client
- Function to fetch GIFs and parse Giphy API response
- Response Formatting
- Implement JSON formatting
- Implement XML formatting
- Research and implement Protobuf formatting
- API Key Management
- Implement SQLite db
- Create DB model
- API Key create, delete function
- API endpoints(router)
- Implement
/giphyendpoint - Implement
/api-keyPOST to create API key - Implement
/api-keyDELETE to delete API key - Write a middleware for API-key in
/giphyroute
- Implement
- Containerize the application using Docker
- Docker Compose
- Implement caching using redis
