Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akhand-pratap-tiwari/product-management-system


https://github.com/akhand-pratap-tiwari/product-management-system

Last synced: 18 days ago
JSON representation

Awesome Lists containing this project

README

        

# Product Management System

## Overview
This is a scalable backend system for product management, built with Go, featuring:
- RESTful API for product operations
- Asynchronous image processing
- Redis caching
- PostgreSQL database
- RabbitMQ for message queuing
- Structured logging

## System Architecture
The system follows a modular architecture with clear separation of concerns:
- **API Layer**: Handles HTTP requests and routing
- **Service Layer**: Implements business logic
- **Repository Layer**: Manages database interactions
- **Caching Layer**: Uses Redis for performance optimization
- **Message Queue**: RabbitMQ for asynchronous image processing

## Prerequisites
- Go 1.20+
- PostgreSQL
- Redis
- RabbitMQ
- AWS S3 (for image storage)

## Configuration
Create a `config.yaml` file with the following structure:
```yaml
database:
host: localhost
port: 5432
user: youruser
password: yourpassword
dbname: productdb

redis:
host: localhost
port: 6379

rabbitmq:
host: localhost
port: 5672

server:
host: localhost
port: 8080

aws:
s3bucket: your-bucket-name
region: us-west-2
```

## Setup and Installation
1. Clone the repository
2. Install dependencies:
```bash
go mod tidy
```
3. Run migrations:
```bash
go run cmd/migrate/main.go
```
4. Start the server:
```bash
go run cmd/api/main.go
```

## API Endpoints
- `POST /api/v1/products`: Create a new product
- `GET /api/v1/products/:id`: Retrieve a specific product
- `GET /api/v1/products`: List products with optional filtering

## Testing
Run tests with:
```bash
go test ./...
```

## Key Features
- Asynchronous image processing
- Distributed caching
- Comprehensive error handling
- Structured logging
- High scalability design

## Performance Considerations
- Redis caching for frequently accessed products
- Asynchronous image processing via message queue
- Efficient database queries with filtering

## Potential Improvements
- Implement more advanced caching strategies
- Add more comprehensive error handling
- Implement circuit breakers for external services
- Add more granular logging