Defined project's directory structure

master
oabrivard 1 month ago
parent c069f6efe1
commit 6e504050f0

@ -198,88 +198,128 @@ CI/CD:
``` ```
knowfoolery/ knowfoolery/
├── docs/ # Project documentation ├── 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/ ├── backend/
│ ├── tools/ # Build tools, code generators
│ ├── services/ # Microservices │ ├── services/ # Microservices
│ │ ├── {service-name}/ │ │ ├── api-gateway/ # Entry point, routes to services
│ │ │ ├── cmd/ │ │ │ ├── cmd/
│ │ │ │ └── main.go # Service entry point │ │ │ │ └── main.go
│ │ │ ├── internal/ │ │ │ └── internal/
│ │ │ │ ├── handlers/ # Fiber HTTP handlers │ │ │ ├── config/
│ │ │ │ ├── app/ # Business logic (commands, queries, dto) │ │ │ │ └── config.go
│ │ │ │ ├── domain/ # Domain logic (aggregates, value objects, repositories interfaces, services from Domain Driven Design) │ │ │ ├── routes/
│ │ │ │ ├── infra/ │ │ │ │ └── router.go
│ │ │ │ │ ├── events/ │ │ │ └── proxy/
│ │ │ │ │ ├── grpc/ │ │ │ └── handlers.go
│ │ │ │ │ └── ent/ # Ent models and schemas + repositories implementation │ │ └── {service-name}/
│ │ │ ├── api/ # API definitions (OpenAPI/gRPC) │ │ ├── cmd/
│ │ │ ├── config/ # Configuration management │ │ │ └── main.go # Service entry point
│ │ │ ├── tests/ # Service-specific tests │ │ ├── config/ # Configuration management (Viper/env configuration)
│ │ │ ├── Dockerfile # Container definition │ │ ├── migrations/ # Ent's migration
│ │ │ └── go.mod # Go module │ │ ├── internal/
│ │ └── shared/ # Shared packages │ │ │ ├── handlers/ # Fiber HTTP handlers
│ │ │ ├── errors/ # Shared domain errors │ │ │ ├── app/ # Business logic (commands, queries, dto)
│ │ │ ├── events/ # Domain events contracts │ │ │ │ ├── command/
│ │ │ ├── types/ # Shared types │ │ │ │ ├── query/
│ │ │ ├── valueobjects/ # Shared value objects │ │ │ │ └── dto/
│ │ │ └── infra/ │ │ │ ├── domain/ # Domain logic in pure Go (Domain Driven Design)
│ │ │ ├── auth/ # JWT middleware & Zitadel integration │ │ │ │ ├── model/ # Aggregates and Value objects
│ │ │ ├── observability/ # Metrics and tracing │ │ │ │ ├── repository/ # Reponsitory interfaces
│ │ │ ├── security/ # Security utilities │ │ │ │ ├── service/ # Services
│ │ │ └── utils/ # Common utilities │ │ │ │ └── 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/ ├── frontend/
│ ├── shared/ │ ├── shared/
│ │ ├── ui-components/ # Shared Gluestack UI components │ │ ├── ui-components/ # Shared UI components
│ │ ├── logic/ # Business logic │ │ ├── logic/ # Business logic
│ │ ├── types/ # TypeScript types │ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions │ │ └── utils/ # Utility functions
│ └── apps/ │ └── apps/
│ ├── web/ # React web app │ ├── web/ # SolidJS web app (Vite + TypeScript)
│ ├── mobile/ # React Native app │ │ ├── package.json
│ └── desktop/ # Wails desktop app │ │ ├── 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 └── infrastructure/ # DevOps and deployment
├── dev/ # Development setup ├── dev/ # Development setup
│ ├── docker-compose.yml # dev stack (hot reload, mounts) │ ├── docker-compose.yml # dev stack (hot reload, mounts)
│ └── api.env # dev env vars │ └── api.env # dev env vars
└── prod/ # Production setup └── prod/ # Production setup
``` │ ├── docker-compose.yml # prod stack
│ └── api.env # prod env vars
### Backend Directory Structure └── services/ # Dockerfiles
```
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
``` ```

Loading…
Cancel
Save