Defined project's directory structure

master
oabrivard 1 month ago
parent c069f6efe1
commit 6e504050f0

@ -198,88 +198,128 @@ CI/CD:
```
knowfoolery/
├── docs/ # Project documentation
│ ├── 1_requirements/ # Functional and Non Functional requirements
│ ├── 2_architecture/ # Application architecture
│ │ ├── decisions/ # ADRs (Architecture Decision Records)
│ │ ├── diagrams/
│ │ └── api-specs/ # OpenAPI specs
│ └── 3_guidelines/ # Project guidelines including design guidelines
├── backend/
│ ├── tools/ # Build tools, code generators
│ ├── services/ # Microservices
│ │ ├── {service-name}/
│ │ ├── api-gateway/ # Entry point, routes to services
│ │ │ ├── cmd/
│ │ │ │ └── main.go # Service entry point
│ │ │ ├── internal/
│ │ │ │ ├── handlers/ # Fiber HTTP handlers
│ │ │ │ ├── app/ # Business logic (commands, queries, dto)
│ │ │ │ ├── domain/ # Domain logic (aggregates, value objects, repositories interfaces, services from Domain Driven Design)
│ │ │ │ ├── infra/
│ │ │ │ │ ├── events/
│ │ │ │ │ ├── grpc/
│ │ │ │ │ └── ent/ # Ent models and schemas + repositories implementation
│ │ │ ├── api/ # API definitions (OpenAPI/gRPC)
│ │ │ ├── config/ # Configuration management
│ │ │ ├── tests/ # Service-specific tests
│ │ │ ├── Dockerfile # Container definition
│ │ │ └── go.mod # Go module
│ │ └── shared/ # Shared packages
│ │ │ ├── errors/ # Shared domain errors
│ │ │ ├── events/ # Domain events contracts
│ │ │ ├── types/ # Shared types
│ │ │ ├── valueobjects/ # Shared value objects
│ │ │ └── infra/
│ │ │ ├── auth/ # JWT middleware & Zitadel integration
│ │ │ ├── observability/ # Metrics and tracing
│ │ │ ├── security/ # Security utilities
│ │ │ └── utils/ # Common utilities
│ │ │ │ └── main.go
│ │ │ └── internal/
│ │ │ ├── config/
│ │ │ │ └── config.go
│ │ │ ├── routes/
│ │ │ │ └── router.go
│ │ │ └── proxy/
│ │ │ └── handlers.go
│ │ └── {service-name}/
│ │ ├── cmd/
│ │ │ └── main.go # Service entry point
│ │ ├── config/ # Configuration management (Viper/env configuration)
│ │ ├── migrations/ # Ent's migration
│ │ ├── internal/
│ │ │ ├── handlers/ # Fiber HTTP handlers
│ │ │ ├── app/ # Business logic (commands, queries, dto)
│ │ │ │ ├── command/
│ │ │ │ ├── query/
│ │ │ │ └── dto/
│ │ │ ├── domain/ # Domain logic in pure Go (Domain Driven Design)
│ │ │ │ ├── model/ # Aggregates and Value objects
│ │ │ │ ├── repository/ # Reponsitory interfaces
│ │ │ │ ├── service/ # Services
│ │ │ │ └── events/ # events
│ │ │ ├── infra/
│ │ │ │ └── ent/ # Ent models and schemas + repositories implementation
│ │ │ │ │ ├── model/ # Ent models and schemas
│ │ │ │ │ │ ├── schema/
│ │ │ │ │ │ ├── generate.go # //go:generate directive
│ │ │ │ │ │ └── ... (generated)
│ │ │ │ │ ├── repository/ # Implements domain interface
│ │ │ │ │ └── mapper/ # ent to domain mapper
│ │ │ │ │
│ │ │ │ └── cache/
│ │ │ └── interfaces/ # Interface adapters (HTTP, gRPC)
│ │ │ ├── events/
│ │ │ ├── api/ # API definitions (OpenAPI/gRPC)
│ │ │ └── http/
│ │ │ ├── handlers/ # Fiber HTTP handlers
│ │ │ └── middleware/
│ │ └── tests/ # Service-specific tests
│ └── shared/ # Shared packages
│ ├── domain/
│ │ ├── errors/ # Shared domain errors
│ │ ├── events/ # Domain events contracts
│ │ ├── types/ # Shared types
│ │ └── valueobjects/ # Shared value objects
│ └── infra/
│ ├── auth/
│ │ ├── zitadel/ # JWT middleware & Zitadel integration
│ │ └── rbac/
│ ├── database/ # Ent database client
│ │ ├── postgres/
│ │ └── redis/
│ ├── observability/ # Metrics and tracing
│ │ ├── logging/ # Structured logging
│ │ ├── tracing/ # OpenTelemetry
│ │ └── metrics/ # Prometheus
│ ├── security/ # Security utilities
│ └── utils/ # Common utilities like httputil (errors, pagintaion, response)
├── frontend/
│ ├── shared/
│ │ ├── ui-components/ # Shared Gluestack UI components
│ │ ├── ui-components/ # Shared UI components
│ │ ├── logic/ # Business logic
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ └── apps/
│ ├── web/ # React web app
│ ├── mobile/ # React Native app
│ └── desktop/ # Wails desktop app
│ ├── web/ # SolidJS web app (Vite + TypeScript)
│ │ ├── package.json
│ │ ├── vite.config.ts
│ │ ├── index.html
│ │ ├── public/
│ │ ├── src/
│ │ │ ├── main.tsx
│ │ │ ├── App.tsx
│ │ │ ├── routes/
│ │ │ ├── layouts/
│ │ │ ├── features/ # Feature-based organization
│ │ │ ├── hooks/ # App-specific hooks
│ │ │ ├── utils/
│ │ │ └── styles/
│ │ │ └── global.css
│ │ └── tsconfig.json
│ └── cross-platform/ # Tauri app (embeds the SolidJS web app)
│ ├── package.json
│ ├── vite.config.ts
│ ├── src/ # Inherits most from web app
│ │ ├── main.tsx
│ │ ├── App.tsx # May wrap web App with desktop-specific logic
│ │ └── platform/ # Desktop-specific code
│ │
│ ├── src-tauri/ # Rust/Tauri native code
│ │ ├── Cargo.toml
│ │ ├── tauri.conf.json
│ │ ├── capabilities/
│ │ ├── icons/
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ ├── lib.rs
│ │ │ ├── commands/ # Tauri commands (Rust ↔ JS bridge)
│ │ │ └── plugins/
│ │ └── build.rs
│ └── tsconfig.json
└── infrastructure/ # DevOps and deployment
├── dev/ # Development setup
│ ├── docker-compose.yml # dev stack (hot reload, mounts)
│ └── api.env # dev env vars
└── prod/ # Production setup
```
### Backend Directory Structure
```
backend/
├── Domain/ # Domain logic (DDD patterns)
├── services/ # Microservices
│ ├── {service-name}/
│ │ ├── cmd/main.go # Service entry point
│ │ ├── internal/
│ │ │ ├── handlers/ # Fiber HTTP handlers
│ │ │ ├── app/ # Business logic
│ │ │ ├── middleware/ # Service-specific middleware
│ │ │ └── models/ # Ent models and schemas
│ │ ├── config/ # Configuration management
│ │ └── tests/ # Service-specific tests
│ └── shared/ # Shared packages
│ ├── auth/ # JWT & Zitadel integration
│ ├── database/ # Ent database client
│ ├── observability/ # Metrics and tracing
│ └── security/ # Security utilities
```
### Frontend Structure
```
frontend/
├── shared/
│ ├── ui-components/ # Shared Gluestack UI components
│ ├── logic/ # Business logic
│ ├── types/ # TypeScript types
│ └── utils/ # Utility functions
└── apps/
├── web/ # SolidJS web app (Vite + TypeScript)
└── cross-platform/ # Tauri app (embeds the SolidJS web app)
```
### Infrastructure Structure
```
Infrastructure/
├── dev/ # Scripts to setup and start development infrastructure
└── prod/ # Scripts to setup and start production infrastructure
│ ├── docker-compose.yml # prod stack
│ └── api.env # prod env vars
└── services/ # Dockerfiles
```

Loading…
Cancel
Save