Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/icemokacat/bruno-viewer

viewer for markdown docs in bru file
https://github.com/icemokacat/bruno-viewer

bruno markdown springboot

Last synced: 2 days ago
JSON representation

viewer for markdown docs in bru file

Awesome Lists containing this project

README

        

# πŸ¦„ Bruno API Client Docs Viewer

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

무료둜 μ‚¬μš©ν•  수 μžˆλŠ” [bruno api client](https://www.usebruno.com/) μ—μ„œ docs 의 λ§ˆν¬λ‹€μš΄μ„ λ³Ό 수 μžˆλŠ” ν”„λ‘œκ·Έλž¨μž…λ‹ˆλ‹€.

[![Report bug][report-bug-shield]][report-bug-url]

# πŸ“‘ Table of Contents

- [About the Project](#about-the-project)
- [Features](#features)
- [Technologies](#technologies)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [1. Page View 방식 (thymeleaf view lendering)](#1-page-view-방식-thymeleaf-view-lendering)
- [2. HTTP API 호좜 방식](#2-http-api-호좜-방식)
- [3. bru collection λ‚΄ 디렉토리 및 bru 파일 리슀트 확인](#3-bru-collection-λ‚΄-디렉토리-및-bru-파일-리슀트-확인)
- [Acknowledgement](#acknowledgement)
- [License](#license)

# πŸ’‘ About the Project

- λΈŒλ£¨λ…Έ Api Client μ—μ„œ μ œκ³΅ν•œλŠ” Docs 만 λ³„λ„λ‘œ κ΄€λ¦¬ν•˜κΈ° μœ„ν•΄ λ§Œλ“€μ–΄μ§„ ν”„λ‘œμ νŠΈμž…λ‹ˆλ‹€.
- λ¬Έμ„œλ§Œ λ³„λ„λ‘œ κ΄€λ¦¬ν•˜λ©΄μ„œ, Front-end μ—μ„œ custom ν•˜κ²Œ λ””μžμΈν•˜μ—¬ λ³΄κΈ°μ’‹κ²Œ κ³΅μœ ν•˜κΈ° μœ„ν•΄ λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€.
- .bru νŒŒμΌμ„ μ½μ–΄μ„œ docs {} λΆ€λΆ„μ˜ markdown 을 μ½μ–΄μ„œ λ³΄μ—¬μ€λ‹ˆλ‹€.

## πŸ“ Features

![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)![Spring](https://img.shields.io/badge/spring-%236DB33F.svg?style=for-the-badge&logo=spring&logoColor=white)![Thymeleaf](https://img.shields.io/badge/Thymeleaf-%23005C0F.svg?style=for-the-badge&logo=Thymeleaf&logoColor=white)

## πŸ”¨ Technologies

- [Gradle](https://gradle.org/) 8.8
- [SpringBoot](https://spring.io/projects/spring-boot) 3.3.3
- [Thymeleaf](https://www.thymeleaf.org/) 3.3.3
- [commonmark](https://commonmark.org/) 0.22.0

# ⚑ Getting Started

## Prerequisites

- Java 17.0.10+11-LTS-240

## Installation
Repository 클둠
```bash
git clone https://github.com/icemokacat/bruno-viewer.git
```

## Configuration

- `application-dev.yml 을 μ°Έκ³ ν•˜μ—¬ application-local.yml 을 λ§Œλ“€μ–΄μ„œ μ‚¬μš©ν•˜μ„Έμš”.`
- Active profiles local 둜 μ„€μ •ν•˜μ—¬ μ‹€ν–‰ν•˜μ„Έμš”.

```yml
server:
port: 7001

bruno:
# .bru 파일이 μžˆλŠ” Collection의 폴더 경둜 ν˜Ήμ€ Collection 이 λͺ¨μ—¬ μžˆλŠ” 루트 path λ₯Ό μ„€μ •ν•˜μ„Έμš”
root-path: C:\work\bruno-project\

```

# Usage

Springboot μ‹€ν–‰ or jar build ν›„ localhost:{port} μ‹€ν–‰

bru 파일의 κ²½λ‘œκ°€ μ•„λž˜μ™€ κ°™μ„λ•Œ
> {root-path}{μƒλŒ€κ²½λ‘œ}

### 1. Page View 방식 (thymeleaf view lendering)

http://localhost:{port}/page/bruno/{μƒλŒ€κ²½λ‘œ} λ₯Ό ν˜ΈμΆœν•˜μ—¬ .bru λ‚΄ markdown 을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

![κ²°κ³Όμ˜ˆμ‹œν™”λ©΄](https://github.com/user-attachments/assets/945e9364-62a7-4c61-a64f-655897f802f3)

πŸ’‘ μ˜ˆμ‹œλ‘œ μ‚¬μš©ν•œ md λ¬Έμ„œλŠ” μ•„λž˜μ˜ λ§ν¬μž…λ‹ˆλ‹€.

> https://gist.github.com/azagniotov/a4b16faf0febd12efbc6c3d7370383a6#file-beautiful-rest-api-docs-in-markdown-md

### 2. HTTP API 호좜 방식

http://localhost:{port}/api/bruno/{μƒλŒ€κ²½λ‘œ} λ₯Ό ν˜ΈμΆœν•˜λ©΄ .bru λ‚΄ markdown 을

html code둜 parsing ν•œ λ¬Έμžμ—΄ 데이터λ₯Ό λ°˜ν™˜ ν•©λ‹ˆλ‹€.

![κ²°κ³Όμ˜ˆμ‹œν™”λ©΄](https://github.com/user-attachments/assets/d1dc0aae-40a0-40c0-886c-38ea071bc6f3)

πŸ’‘ μ˜ˆμ‹œλ‘œ μ‚¬μš©ν•œ md λ¬Έμ„œλŠ” μ•„λž˜μ˜ λ§ν¬μž…λ‹ˆλ‹€.

> https://gist.github.com/azagniotov/a4b16faf0febd12efbc6c3d7370383a6#file-beautiful-rest-api-docs-in-markdown-md

### 3. bru collection λ‚΄ 디렉토리 및 bru 파일 리슀트 확인

http://localhost:{port}/api/bruno-path
- Method : GET
- Parameter : dir (폴더λͺ…)
- Response OK Data
```json
{
"httpStatus": "OK",
"message": "OK",
"data": [
{
"isBru": false,
"directoryPath": "myapp/environments",
"directoryName": "environments"
},
{
"isBru": true,
"directoryPath": "myapp/login.bru",
"directoryName": "login.bru"
}
]
}
```

# πŸ“š Acknowledgement

- [Markdown to html (commonmark)](https://mvnrepository.com/artifact/org.commonmark/commonmark)
- [Spring으둜 markdown view λ§Œλ“€κΈ°](https://devocean.sk.com/blog/techBoardDetail.do?ID=163499)
- [Github Markdown CSS](https://github.com/sindresorhus/github-markdown-css) by [sindresorhus](https://github.com/sindresorhus)

# ✨ License
Apache License 2.0

λΌμ΄μ„ΌμŠ€μ— λŒ€ν•œ μ •λ³΄λŠ” [`LICENSE`](/LICENSE)에 μžˆμŠ΅λ‹ˆλ‹€.

[report-bug-shield]: https://img.shields.io/badge/-%F0%9F%90%9E%20report%20bug-F5A9A9?style=for-the-badge
[report-bug-url]: https://github.com/icemokacat/bruno-viewer/issues