Skip to content

Commit 9230495

Browse files
committed
add initial implementation
0 parents  commit 9230495

92 files changed

Lines changed: 8512 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/mvnw text eol=lf
2+
*.cmd text eol=crlf

.github/workflows/ci.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- src/**
8+
- pom.xml
9+
- .github/workflows/*
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- src/**
15+
- pom.xml
16+
- .github/workflows/*
17+
jobs:
18+
unit-test:
19+
uses: categolj/workflows/.github/workflows/unit-test.yaml@main
20+
build-oci-image-jvm-amd64:
21+
needs: unit-test
22+
uses: categolj/workflows/.github/workflows/build-oci-image-jvm.yaml@main
23+
with:
24+
image_name: jvm_amd64
25+
image_file: jvm_amd64.yaml
26+
runs_on: ubuntu-latest
27+
build-oci-image-jvm-aarch64:
28+
needs: unit-test
29+
uses: categolj/workflows/.github/workflows/build-oci-image-jvm.yaml@main
30+
with:
31+
image_name: jvm_aarch64
32+
image_file: jvm_aarch64.yaml
33+
runs_on: ubuntu-24.04-arm
34+
push-multi-arch-image-jvm:
35+
needs:
36+
- build-oci-image-jvm-amd64
37+
- build-oci-image-jvm-aarch64
38+
uses: categolj/workflows/.github/workflows/push-multi-arch-image.yaml@main
39+
with:
40+
prefix: jvm
41+
save-image-jvm-amd64:
42+
needs: build-oci-image-jvm-amd64
43+
uses: categolj/workflows/.github/workflows/save-images.yaml@main
44+
with:
45+
image_name: jvm_amd64
46+
image_file: jvm_amd64.yaml
47+
save-image-jvm-aarch64:
48+
needs: build-oci-image-jvm-aarch64
49+
uses: categolj/workflows/.github/workflows/save-images.yaml@main
50+
with:
51+
image_name: jvm_aarch64
52+
image_file: jvm_aarch64.yaml

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
HELP.md
2+
target/
3+
.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
!**/src/main/**/build/
30+
!**/src/test/**/build/
31+
32+
### VS Code ###
33+
.vscode/
34+
35+
application-default.properties
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

CLAUDE.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this
4+
repository.
5+
6+
## Build and Development Commands
7+
8+
This is a Spring Boot 3.x application using Maven with Java 21.
9+
Code formatting is enforced using the Spring Java Format plugin.
10+
11+
**Build Commands:**
12+
13+
```bash
14+
./mvnw clean spring-javaformat:apply package # Build application
15+
./mvnw spring-boot:run # Run application locally
16+
./mvnw spring-javaformat:apply test # Run all tests
17+
```
18+
19+
## Architecture Overview
20+
21+
### Core Structure
22+
23+
- **Package**: `am.ik.blog` - Main application package
24+
- **Domain**: `am.ik.blog.entry` - Blog entry domain model and repository
25+
- **Config**: `am.ik.blog.config` - GemFire and application configuration
26+
- **Markdown**: `am.ik.blog.markdown` - Markdown processing with YAML front matter
27+
- **Web**: `am.ik.blog.entry.web` - REST API controllers
28+
29+
### Domain Model
30+
31+
- **Entry**: Main blog entry entity with ID, title, content, categories, tags, frontMatter
32+
- **Author**: Author information with name, URL, GitHub
33+
- **Category/Tag**: Simple categorization entities
34+
- **FrontMatter**: YAML metadata container
35+
36+
## Key Dependencies and Patterns
37+
38+
### Technology Stack
39+
40+
- **Spring Boot 3.5**
41+
- **VMware GemFire 10.1**
42+
- **Java 21**
43+
- **Jilt** for builder pattern generation
44+
45+
### Design Patterns
46+
47+
- **Repository Pattern**: `EntryRepository` with dual-source strategy (cache + external API)
48+
- **Builder Pattern**: Generated via `@Builder` annotation from Jilt
49+
- **Record Classes**: Used for configuration properties (`EntryProps`)
50+
51+
## Development Requirements
52+
53+
### Prerequisites
54+
55+
- Java 25 runtime
56+
57+
### Code Standards
58+
59+
- Use builder pattern if the number of arguments is more than two
60+
- Write javadoc and comments in English
61+
- Spring Java Format enforced via Maven plugin
62+
- All code must pass formatting validation before commit
63+
- Use Java 25 compatible features
64+
- Use modern Java technics as much as possible like Java Records, Pattern Matching, Text Block
65+
etc ... but don't use "var".
66+
- Be sure to avoid circular references between classes and packages.
67+
- Don't use Lombok.
68+
- Don't use Google Guava.
69+
70+
### Spring Specific Rules
71+
72+
- Always use constructor injection for Spring beans. No `@Autowired` required except for test code.
73+
- Use `RestClient` for external API calls. Don't use `RestTemplate`.
74+
- `RestClient` should be used with injected/autoconfigured `RestClient.Builder`.
75+
- Use `JdbcClient` for database operations. Don't use `JdbcTemplate` except for batch update.
76+
- Use `@Configuration(proxyBeanMethods = false)` for configuration classes to avoid proxying issues.
77+
- Use `@ConfigurationProperties` + Java Records for configuration properties classes. Don't use
78+
`@Value` for configuration properties.
79+
- Use `@DefaultValue` for non-null default values in configuration properties classes.
80+
81+
### Package Structure
82+
83+
Package structure should follow the "package by feature" principle, grouping related classes
84+
together. Not by technical layers.
85+
Exceptionally, web related classes including Controllers should be located in `web` package under the
86+
feature package. Other layers should not have dedicated packages like "service", "repository", "dto"
87+
etc...
88+
89+
`web` package should not be shared across different features. Each feature should have its own `web`
90+
domain objects should be clean and not contain external layers like web or database.
91+
92+
For DTOs, use inner record classes in the appropriate classes. For example, if you have a
93+
`UserController`, define the request/response class inside that controller class.
94+
95+
### Testing Strategy
96+
97+
:
98+
99+
- **Unit Tests**: JUnit 5 with AssertJ for service layer testing
100+
- **Integration Tests**: `@SpringBootTest` + Testcontainers for full application context
101+
- **Test Data Management**: Use `@TempDir` for filesystem testing, maintain test independence
102+
- All tests must pass before completing tasks
103+
- Test coverage includes artifact operations, repository browsing, and API endpoints
104+
105+
### After Task completion
106+
107+
- Ensure all code is formatted using `./mvnw spring-javaformat:apply`
108+
- For each task, notify that the task is complete and ready for review by the following command:
109+
110+
```
111+
osascript -e 'display notification "<Message Body>" with title "<Message Title>"’
112+
```

compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
postgres:
3+
image: 'postgres:latest'
4+
environment:
5+
- 'POSTGRES_DB=mydatabase'
6+
- 'POSTGRES_PASSWORD=secret'
7+
- 'POSTGRES_USER=myuser'
8+
ports:
9+
- '5432'

0 commit comments

Comments
 (0)