62 lines
No EOL
2.6 KiB
Markdown
62 lines
No EOL
2.6 KiB
Markdown
# Project Structure
|
|
|
|
## Root Directory
|
|
```
|
|
stock-bot/
|
|
├── apps/ # Microservice applications
|
|
│ ├── data-ingestion/ # Market data ingestion service
|
|
│ ├── data-pipeline/ # Data processing pipeline
|
|
│ ├── web-api/ # REST API service
|
|
│ └── web-app/ # React dashboard
|
|
├── libs/ # Shared libraries
|
|
│ ├── core/ # Core functionality
|
|
│ │ ├── config/ # Configuration management
|
|
│ │ ├── logger/ # Logging infrastructure
|
|
│ │ ├── di/ # Dependency injection
|
|
│ │ ├── types/ # Shared TypeScript types
|
|
│ │ └── handlers/ # Common handler patterns
|
|
│ ├── data/ # Database clients
|
|
│ │ ├── postgres/ # PostgreSQL client
|
|
│ │ ├── questdb/ # QuestDB time-series client
|
|
│ │ └── mongodb/ # MongoDB document storage
|
|
│ ├── services/ # Service utilities
|
|
│ │ ├── queue/ # BullMQ job processing
|
|
│ │ ├── event-bus/ # Dragonfly event bus
|
|
│ │ └── shutdown/ # Graceful shutdown
|
|
│ └── utils/ # Utility functions
|
|
├── database/ # Database schemas and migrations
|
|
├── scripts/ # Build and utility scripts
|
|
├── config/ # Configuration files
|
|
├── monitoring/ # Monitoring configurations
|
|
├── docs/ # Documentation
|
|
└── test/ # Global test utilities
|
|
|
|
## Key Files
|
|
- `package.json` - Root package configuration
|
|
- `turbo.json` - Turbo monorepo configuration
|
|
- `tsconfig.json` - TypeScript configuration
|
|
- `eslint.config.js` - ESLint rules
|
|
- `.prettierrc` - Prettier formatting rules
|
|
- `docker-compose.yml` - Infrastructure setup
|
|
- `.env` - Environment variables
|
|
|
|
## Monorepo Structure
|
|
- Uses Bun workspaces with Turbo for orchestration
|
|
- Each app and library has its own package.json
|
|
- Shared dependencies at root level
|
|
- Libraries published as `@stock-bot/*` packages
|
|
|
|
## Service Architecture Pattern
|
|
Each service typically follows:
|
|
```
|
|
service/
|
|
├── src/
|
|
│ ├── index.ts # Entry point
|
|
│ ├── routes/ # API routes (Hono)
|
|
│ ├── handlers/ # Business logic
|
|
│ ├── services/ # Service layer
|
|
│ └── types/ # Service-specific types
|
|
├── test/ # Tests
|
|
├── package.json
|
|
└── tsconfig.json
|
|
``` |