- About the Project
- Tech Stack
- Architecture
- Getting Started
- Configuration
- Available Scripts
- API Documentation
- Contributing
- License
Backend microservice implementing Clean Architecture and SOLID principles in TypeScript, providing data services for the Infinity ecosystem. This service is optimized for high availability and scalability.
- 🏗️ Clean and modular architecture
- 🔐 Secure API endpoints
- 💬 Ethereum and Loyalty services
- 🚀 Performance optimized with compression
- 📊 Structured logging with Winston
- Runtime: Node.js 22.11.0
- Language: TypeScript 5.7.2
- Framework: Express 4.21.1
- Logger: Winston
- Security: Helmet, HPP, Rate Limiting
- API: Express with compression
- File Handling: Multer
- Linting: ESLint + Prettier
- Type Checking: TypeScript
- Development: ts-node-dev
- Build: tsc with path aliases
- Environment: Cross-env
- Date Handling: Day.js
- Logging: Winston with daily rotation
📦 src
├── 🎯 domain/
│ ├── adapters/ # Interface adapters
│ ├── aggregates/ # Domain aggregates
│ ├── dto/ # Data transfer objects
│ ├── entity/ # Domain entities
│ ├── enums/ # Enumerations
│ ├── errors/ # Custom error definitions
│ ├── events/ # Domain events
│ ├── facades/ # Facade patterns
│ ├── factories/ # Factory patterns
│ └── observers/ # Observer patterns
│
├── 🏗️ infraestructure/
│ ├── databases/ # Database implementations
│ │ ├── firestore/
│ │ ├── mongodb/
│ │ ├── postgresql/
│ │ └── redis/
│ └── services/ # Infrastructure services
│
├── 🎨 presentation/
│ ├── Bootstrap/ # Application bootstrap
│ │ ├── controllers/
│ │ ├── middlewares/
│ │ ├── routes/
│ │ └── services/
│ └── Infinity/ # Infinity module
│ ├── controllers/
│ ├── repositories/
│ ├── routes/
│ └── services/
│
└── 🛠️ utils/
├── environment/ # Environment configuration
├── exceptions/ # Exception handling
├── loggerConfig/ # Logging configuration
├── readFile/ # File reading utilities
├── system/ # System utilities
└── times/ # Time handling utilities
node -v # >= 22.10.0
yarn -v # >= 1.22.20- Clone the repository
git clone https://github.com/infinity/data-service.git
cd data-service- Install dependencies
yarn install- Configure environment variables
cp .env.example .env# Server Configuration
PORT=9000
NODE_ENV=development
API_PREFIX=/api/v1
# SSL Configuration (Optional)
SSL_KEY_PATH=./ssl/key.pem
SSL_CERT_PATH=./ssl/cert.pem
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=100
# Logging
LOG_LEVEL=info
LOG_FORMAT=combined# Development
yarn local # Start development server with hot-reload
yarn build # Build for production
yarn start # Start production server
yarn clean # Clean build directory
# Code Quality
yarn lint # Run ESLint
yarn lint:fix # Fix ESLint issues
yarn format # Format code with Prettier
yarn deps:check # Check for dependency updatesThe API is organized into two main modules:
Handles Ethereum-related functionality through EthereumController:
- Authentication
- Transaction management
- Smart contract interactions
Manages loyalty program features through LoyaltyController:
- Points tracking
- Rewards management
- User loyalty status
- Fork the repository
- Create your feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'feat: Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
We follow Conventional Commits:
feat: New featurefix: Bug fixdocs: Documentationstyle: Style changesrefactor: Code refactoringtest: Add or modify testschore: Maintenance tasks
- Update README.md with details of changes if applicable
- Update version numbers in relevant files
- Ensure all tests pass
- Get approval from at least one developer
- Merge only after QA approval
This project is under INFINITY License - see the LICENSE.md file for details.
