Skip to content

Commit b3dd8ca

Browse files
authored
Merge pull request #71 from nramc/70-blog-base-setup
70 blog base setup
2 parents fcce4ef + adf375f commit b3dd8ca

8 files changed

+648
-1
lines changed
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* Card container to style individual blog posts */
2+
.card {
3+
border-radius: 8px;
4+
border: 2px solid whitesmoke;
5+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
6+
padding: 20px;
7+
transition: transform 0.3s ease, box-shadow 0.3s ease;
8+
}
9+
10+
/* Image inside the card */
11+
.md-post__header img {
12+
width: 50px;
13+
height: 50px;
14+
border-radius: 50%;
15+
margin-right: 10px;
16+
}
17+
18+
/* Meta info (date, tags, etc.) styling */
19+
.md-meta__list {
20+
list-style: none;
21+
padding: 0;
22+
font-size: 0.65rem;
23+
color: #555;
24+
}
25+
26+
.md-meta__item {
27+
margin-bottom: 10px;
28+
}
29+
30+
.md-meta__link {
31+
color: #0077cc;
32+
text-decoration: none;
33+
transition: color 0.3s ease;
34+
}
35+
36+
.md-meta__link:hover {
37+
color: #005fa3;
38+
}
39+
40+
/* Post content styling */
41+
.md-post__content {
42+
line-height: 1.8;
43+
color: #333;
44+
}
45+
46+
/* Excerpt styling */
47+
.md-post--excerpt {
48+
margin-bottom: 1rem;
49+
}
50+
51+
.md-post--excerpt .md-post__content {
52+
display: block;
53+
}
54+
55+
.md-post__content .read-more {
56+
font-size: 16px;
57+
font-weight: normal;
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
author: Ramachandran Nellaiyappan
3+
title: "HTTP Client - IntelliJ Plugin"
4+
date: 2024-10-07
5+
updated:
6+
categories:
7+
- Testing
8+
tags:
9+
- Http Client
10+
- Productivity
11+
- Workstation-Setup
12+
- Testing
13+
hide:
14+
- toc
15+
---
16+
17+
# HTTP Client - IntelliJ Plugin
18+
19+
- [HTTP Client](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) helps to create, edit, and
20+
execute HTTP requests directly in the IntelliJ IDEA code editor.
21+
- It provides varies features like configuring env variable file with support for environments like dev, qa and live
22+
23+
## Environment files
24+
25+
- create environment file in project test source directory `src/test/http-client/http-client.env.json`
26+
- Configure environment variables based on different environments
27+
28+
```json
29+
{
30+
"dev": {
31+
"appURL": "https://example-dev.com"
32+
},
33+
"qa": {
34+
"appURL": "https://example-qa.com"
35+
},
36+
"live": {
37+
"appURL": "https://example.com"
38+
}
39+
}
40+
```
41+
42+
## HTTP Scripts
43+
44+
- please find below sample http script from `src/test/http-client/scripts/`
45+
46+
```
47+
48+
# Constant values
49+
@usecase = REGISTRATION
50+
51+
### Registration
52+
# this is pre javascript block executed before http request executed
53+
< {%
54+
const pepperVal = request.environment.get("someConfidentialEnvironmentSpecificValue")
55+
const dateUtcIsoFormat = new Date().toISOString().split('T')[0];
56+
const formattedEntityVal = pepperVal + ':' + dateUtcIsoFormat;
57+
58+
const hashedEntity = crypto.sha256().updateWithText(formattedEntityVal, 'UTF-8').digest().toBase64(true);
59+
60+
// Dynamically derived value added to request context and can be used in http request
61+
request.variables.set("dynamicHashedEntity", hashedEntity)
62+
63+
%}
64+
POST {{appURL}}
65+
Content-Type: application/vnd.registration+json
66+
67+
{
68+
"name": "My Name",
69+
"emailAddress": "[email protected]",
70+
"signature": "{{hashedEntity}}",
71+
}
72+
73+
// this is post javascript block executed after http request executed
74+
> {%
75+
client.test("Request executed successfully", function () {
76+
client.assert(response.status === 201, "Response failed");
77+
client.global.set("emailToken", response.body.code)
78+
});
79+
%}
80+
81+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: "IntelliJ IDEA Live Templates"
3+
author: Ramachandran Nellaiyappan
4+
date: 2025-03-11
5+
updated:
6+
categories:
7+
- Workstation Setup
8+
tags:
9+
- Workstation Setup
10+
- Productivity
11+
---
12+
13+
# IntelliJ IDEA Live Templates
14+
15+
16+
!!! tip "You can download all below live templates as a file"
17+
18+
[Download File](../../assets/data/intellij-idea-live-templates/custom-intellij-idea-live-templates.xml){ .md-button .md-button--primary }
19+
20+
You can place them inside your IntelliJ IDEA in `~/Library/Application Support/JetBrains/<IntelliJIdea version>/templates/`
21+
22+
23+
## Java
24+
25+
**Static Factory Method**
26+
27+
```shell
28+
# Template Name: factoryMethod
29+
public static $CLASS_NAME$ valueOf($PARAM_TYPE$ $PARAM_NAME$) {
30+
return new $CLASS_NAME$($PARAM_NAME$);
31+
}
32+
33+
# Parameters binding:
34+
CLASS_NAME -> className()
35+
PARAM_TYPE -> guessElementType()
36+
PARAM_NAME -> suggestVariableName()
37+
38+
```
39+
40+
**Command Line Runner**
41+
```shell
42+
43+
# Template Name: commandLineRunner
44+
@org.springframework.context.annotation.Bean
45+
CommandLineRunner $BEAN_NAME$() {
46+
return args -> {};
47+
}
48+
49+
# Parameters binding:
50+
BEAN_NAME -> suggestVariableName()
51+
52+
```
53+
54+
**Spring Mock MVC Test**
55+
```shell
56+
# Template Name: mvcTest
57+
@org.junit.jupiter.api.Test
58+
void $TEST_METHOD$() throws Exception {
59+
mockMvc.perform(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get("$ENDPOINT$"))
60+
.andDo(org.springframework.test.web.servlet.result.MockMvcResultHandlers.print())
61+
.andExpect(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status().isOk());
62+
}
63+
64+
# Parameter binding:
65+
TEST_METHOD -> methodName()
66+
ENDPOINT -> "/api/example"
67+
```
68+
69+
**Constant**
70+
```shell
71+
# Template Name: constant
72+
private static final $VAR_TYPE$ $VAR_NAME$ = "$VALUE$";
73+
74+
# Parameter bindings:
75+
VAR_TYPE -> "String" / "int" / "boolean" / "List<String>"
76+
VAR_NAME -> variableName()
77+
VALUE -> guessValue($VAR_TYPE$)
78+
```
79+
80+
## MkDocs
81+
82+
**MkDocs Metadata**
83+
84+
```shell
85+
# Template Name: mkdocs-meta-data
86+
---
87+
author: $USER$
88+
createdAt: $DATE$
89+
updatedAt:
90+
categories:
91+
- $END$
92+
tags:
93+
- todo
94+
---
95+
96+
# Parameter bindings:
97+
USER -> "Ramachandran Nellaiyappan"
98+
DATE -> date("d.MM.YYYY")
99+
100+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Checklist for creating Java Application/Service"
3+
author: Ramachandran Nellaiyappan
4+
date: 2024-10-28
5+
updated:
6+
categories:
7+
- Guideline
8+
tags:
9+
- Application Checklist
10+
- Java
11+
hide:
12+
- toc
13+
---
14+
15+
# Checklist for creating Java Application/Service
16+
17+
This article outlines the essential steps and considerations for Creating a new Java Application or Service
18+
19+
- [x] [Spring Initializr](https://start.spring.io/) is great tool for creating initial projects with predefined initial
20+
setup. I find it really helpful.
21+
- [x] Set up Sonar project for the repository. If it is open source
22+
project, [Sonar Cloud](https://www.sonarsource.com/products/sonarcloud/) is really helpful for maintaining good
23+
quality code
24+
- [x] Setup Continues Integration(CI) workflow for each commit and merge request. Feel free to have
25+
look: [Journey API | ci-build-workflow.yml](https://github.com/nramc/journey-api/blob/main/.github/workflows/ci-build-workflow.yml)
26+
- [x] Setup Continues Deployment(CD) workflow for automated deployment to QA & LIVE environments. Feel free to have
27+
look: [Journey API | release-workflow.yml](https://github.com/nramc/journey-api/blob/main/.github/workflows/release-workflow.yml)
28+
- [x] [Docker Compose](https://docs.spring.io/spring-boot/how-to/docker-compose.html) really helps and boost developer
29+
productivity and reduce complexity for environment setup.
30+
- [x] Containerization: Use Docker or other container solutions to package the application consistently. Feel free to
31+
have look [Journey API | Dockerfile](https://github.com/nramc/journey-api/blob/main/Dockerfile)
32+
- [x] [Renovate Bot](https://docs.renovatebot.com/) integration really helps to automatically update dependencies. Feel
33+
free to have look [Journey API | renovate.json](https://github.com/nramc/journey-api/blob/main/renovate.json)
34+
- [x] [OpenRewrite](https://docs.openrewrite.org/) integration really powerful tool to maintain good code quality and
35+
automated refactoring to reduce technical debt. Feel free to have
36+
look [Journey API | rewrite.yml](https://github.com/nramc/journey-api/blob/main/rewrite.yml)
37+
- [x] [Open API with Swagger](https://swagger.io/docs/) Document the code and create developer-friendly API
38+
documentation. Personally I would recommend Open API Specification with Swagger UI. Feel free to have
39+
look [Journey API Configuration](https://github.com/nramc/journey-api/blob/main/src/main/resources/application.yml) & [REST API Documentation](https://github.com/nramc/journey-api/tree/main?tab=readme-ov-file)

0 commit comments

Comments
 (0)