Skip to content

Commit 3c139d1

Browse files
committed
Add gemini context
1 parent 65762b2 commit 3c139d1

File tree

11 files changed

+528
-2
lines changed

11 files changed

+528
-2
lines changed

.idea/runConfigurations/ktfmtCheck.xml renamed to .idea/runConfigurations/Apply_Formatting.xml

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GEMINI.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Gemini Context: DataSource-Extensions
2+
3+
This document provides context and instructions for working with the `DataSource-Extensions` project.
4+
5+
## Project Overview
6+
7+
`DataSource-Extensions` is a collection of libraries and extensions for the Caplin DataSource platform. It focuses on modernizing integrations using Reactive programming models and Spring Boot.
8+
9+
**Key Technologies:**
10+
* **Languages:** Kotlin (primary), Java
11+
* **Build System:** Gradle (Kotlin DSL)
12+
* **Frameworks:** Spring Boot 3.x, Caplin DataSource, Project Reactor, Kotlin Coroutines (Flow)
13+
* **Testing:** Kotest, Turbine, MockK, JUnit 5
14+
15+
## Architecture & Modules
16+
17+
The project is a multi-module Gradle project:
18+
19+
* **`datasourcex-reactive-core` & `api`**: Core abstractions for reactive data sources.
20+
* **`datasourcex-kotlin`**: Support for Kotlin Flow and Coroutines.
21+
* **`datasourcex-java-flow`**: Support for Java Flow (Flow API).
22+
* **`datasourcex-reactivestreams`**: Support for Reactive Streams (Reactor Flux/Mono, RxJava).
23+
* **`spring-boot-starter-datasource`**: A Spring Boot starter for easy integration, utilizing `@MessageMapping` for real-time endpoints.
24+
* **`datasourcex-util`**: Utility classes.
25+
* **`examples`**: Example applications (Spring Java/Kotlin, Chat app).
26+
27+
## Building and Running
28+
29+
### Prerequisites
30+
* JDK 17+
31+
* `CAPLIN_USERNAME` and `CAPLIN_PASSWORD` environment variables are required to resolve dependencies from the Caplin repository.
32+
33+
### Gradle Commands
34+
35+
* **Build:**
36+
```bash
37+
./gradlew build
38+
```
39+
* **Test:**
40+
```bash
41+
./gradlew test
42+
```
43+
* **Format Code (Apply):**
44+
```bash
45+
./gradlew spotlessApply
46+
```
47+
* **Check Code Formatting:**
48+
```bash
49+
./gradlew spotlessCheck
50+
```
51+
* **Run Example (Spring Boot):**
52+
```bash
53+
./gradlew :examples:spring-kotlin:bootRun
54+
```
55+
56+
## Development Conventions
57+
58+
* **Code Style:** The project uses `spotless` with `ktfmt` for code formatting. Always run `./gradlew spotlessApply` before committing.
59+
* **Testing:**
60+
* Use **Kotest** for assertions (`shouldBe`, etc.).
61+
* Use **Turbine** for testing Kotlin Flows.
62+
* Use **MockK** for mocking dependencies.
63+
* Tests are typically JUnit 5 based.
64+
* **Documentation:** KDoc is used for API documentation. The `docs` module and `spring/docs/GUIDE.md` contain usage guides.
65+
66+
## Common Tasks
67+
68+
### Adding a new Reactive Endpoint (Spring)
69+
1. Create a `@Controller`.
70+
2. Annotate a function with `@MessageMapping("/subject")`.
71+
3. Return a `Flow<T>` (Kotlin) or `Flux<T>` (Java).
72+
73+
### Testing a Flow
74+
Use `turbine` to verify the emission of items:
75+
```kotlin
76+
myFlow.test {
77+
awaitItem() shouldBe expectedItem
78+
awaitComplete()
79+
}
80+
```
81+
82+
## Key Files & Directories
83+
84+
* `spring/docs/GUIDE.md`: Comprehensive guide on using the Spring Boot starter.
85+
* `buildSrc/src/main/kotlin/common-library.gradle.kts`: Shared build logic for libraries.
86+
* `gradle/libs.versions.toml`: Version catalog for dependency management.

conductor/code_styleguides/java.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Java Style Guide
2+
3+
This project follows the **Google Java Style Guide**.
4+
5+
## Key Principles
6+
- **Automatic Formatting:** All Java code is automatically formatted using the `spotlessApply` Gradle task.
7+
- **Google Java Format:** We use the `google-java-format` plugin via Spotless.
8+
- **Standards:** Adhere strictly to the Google Java Style conventions for naming, formatting, and structure.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Kotlin Style Guide
2+
3+
This project follows the **ktfmt** (Kotlin Format) style guide.
4+
5+
## Key Principles
6+
- **Automatic Formatting:** All Kotlin code is automatically formatted using the `spotlessApply` Gradle task.
7+
- **ktfmt:** We use the `ktfmt` formatter with the default configuration.
8+
- **Consistency:** Maintain consistent indentation and spacing as enforced by the tool.

conductor/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Project Context
2+
3+
## Definition
4+
- [Product Definition](./product.md)
5+
- [Product Guidelines](./product-guidelines.md)
6+
- [Tech Stack](./tech-stack.md)
7+
8+
## Workflow
9+
- [Workflow](./workflow.md)
10+
- [Code Style Guides](./code_styleguides/)
11+
12+
## Management
13+
- [Tracks Registry](./tracks.md)
14+
- [Tracks Directory](./tracks/)

conductor/product-guidelines.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Product Guidelines
2+
3+
## Development Philosophy
4+
5+
### Readability & Maintainability
6+
The primary focus for all development within this project is readability and maintainability. We favour clear, idiomatic Kotlin and Java that is easy for the maintenance team to understand and evolve. This means prioritizing expressive code over extreme performance micro-optimizations, unless a significant performance bottleneck is identified.
7+
8+
### Error Handling & Robustness
9+
We follow a **Fail-Fast & Explicit** philosophy. Errors should be surfaced clearly to the user rather than being silently handled or ignored. While we use standard exceptions for error reporting, we strive to make error states predictable and minimize their occurrence through careful API design.
10+
11+
## Documentation & Knowledge Sharing
12+
13+
### Example-Driven Documentation
14+
Our documentation philosophy is **Example-Driven**. We prioritize extensive, runnable code snippets and hands-on tutorials (like the existing `GUIDE.md`) to help developers integrate the library into their Spring Boot applications as quickly as possible. Every major feature should be accompanied by at least one clear example.
15+
16+
## Quality Assurance
17+
18+
### Comprehensive Integration Testing
19+
Given the complex interactions between the reactive modules, the Spring Boot starter, and the Caplin DataSource platform, we prioritize **Comprehensive Integration Testing**. We focus on testing these components in realistic, end-to-end scenarios to ensure that the entire stack functions correctly under real-world conditions.
20+
21+
## Versioning & Compatibility
22+
23+
### Strict Semantic Versioning
24+
We strictly adhere to **Semantic Versioning (SemVer)**. We guarantee that no breaking changes to the public API will be introduced without a major version increment. This ensures stability and trust for the financial application developers who depend on these extensions.

conductor/product.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Initial Concept
2+
`DataSource-Extensions` is a collection of libraries and extensions for the Caplin DataSource platform. It focuses on modernizing integrations using Reactive programming models and Spring Boot.
3+
4+
## Product Definition
5+
6+
### Core Objective
7+
The primary focus for the next phase of development is to enhance the Spring Boot starter and its integration with Spring Messaging, while simultaneously improving project infrastructure and ensuring general library maintenance.
8+
9+
### Target Audience
10+
* **Financial Application Developers:** Engineers using Caplin DataSource who wish to adopt modern Spring Boot and Reactive patterns (e.g., Kotlin Flow, Project Reactor).
11+
* **Maintenance Team:** Internal developers responsible for the long-term reliability, documentation, and evolution of the `DataSource-Extensions` library.
12+
13+
### Key Goals
14+
* **Developer Experience:** Simplify and polish the experience of creating real-time endpoints using the `@MessageMapping` annotation within the Spring Boot starter.
15+
* **Quality Assurance:** Significantly increase unit and integration test coverage, specifically targeting the Spring Boot auto-configuration logic and reactive bindings.
16+
* **Knowledge Management:** Modernize and expand the existing usage guides and API documentation (KDoc) to ensure the library is accessible and well-documented for end-users.
17+
18+
### Constraints & Non-Functional Requirements
19+
* **Backward Compatibility:** Maintain strict compatibility with existing Caplin DataSource implementations to ensure smooth migration paths for current users.
20+
* **High Performance:** Ensure minimal runtime overhead for all reactive wrappers, preserving the low-latency characteristics of the underlying platform.
21+
* **Up-to-Date Ecosystem:** Ensure full compatibility with the latest stable versions of Kotlin and Spring Boot as specified in the project's version catalog.
22+
23+
### Maintenance Priorities
24+
* **Dependency Management:** Proactively keep internal and external dependencies up-to-date and swiftly resolve any version conflicts.

conductor/setup_state.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"last_successful_step": "2.5_workflow"}

conductor/tech-stack.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Technology Stack
2+
3+
## Core Technologies
4+
- **Languages:** Kotlin 1.9.25 (Primary), Java 17
5+
- **Build System:** Gradle (Kotlin DSL)
6+
7+
## Frameworks & Platforms
8+
- **Spring Boot:** 3.5.0
9+
- **Caplin Platform:** DataSource Java SDK
10+
- **Reactive Libraries:** Project Reactor (Flux/Mono), Kotlin Coroutines (Flow), Reactive Streams
11+
12+
## Quality & Tooling
13+
- **Testing:** Kotest, Turbine, MockK
14+
- **Formatting & Linting:** Spotless (using ktfmt)
15+
- **Documentation:** Dokka (KDoc)
16+
- **Coverage:** Kover
17+
18+
## Future Roadmap
19+
- Upgrade to **Spring Boot 4** and **Kotlin 2** in a future phase.

conductor/tracks.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Tracks Registry
2+
3+
---
4+
5+
- [x] **Track: Add ability to publish Caplin DataSource Containers from Spring @DataMessageMapping annotated functions**
6+
*Link: [./tracks/spring-container-mapping_20250610/](./tracks/spring-container-mapping_20250610/)*

0 commit comments

Comments
 (0)