Skip to content

Commit 2d03fd8

Browse files
committed
documentation review and changes
1 parent b073811 commit 2d03fd8

1 file changed

Lines changed: 195 additions & 28 deletions

File tree

README.md

Lines changed: 195 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Can scaffold and maintain your cloud solution on top of Cloudharness without wri
77
Kubernetes templates, with in place common utilities and applications already configured for you.
88

99
What building your cloud solution with CloudHarness gives to you:
10+
1011
- Common framework and utilities to develop and deploy micro-service application
12+
1113
- Helm chart automatic generation
1214
- deployments
1315
- services
@@ -23,11 +25,13 @@ What building your cloud solution with CloudHarness gives to you:
2325
- databases (postgreql)
2426
- access gatekeepers configuration
2527
- secrets and configmaps
28+
2629
* Automatic build and push of images
2730
* REST-API scaffolding building based on OpenApi
2831
* Continuous deployment script generation
2932
* Debug backend applications running on Kubernetes
3033
* Python cluster access utilities
34+
3135
* Prebuilt support applications and shared library to:
3236
* Log in and user management - based on Keycloak
3337
* Submit batch and asynchronous workflows - based on Argo
@@ -43,17 +47,18 @@ What building your cloud solution with CloudHarness gives to you:
4347

4448
The microservice architecture is a great to get code separation and flexible development, but may not be of easy implementation, especially for small development teams/projects.
4549
In particular, these questions may rise:
46-
- How do I create a deployment for my microservices?
47-
- How do I orchestrate my microservices?
48-
- How to create consistent api documentation?
49-
- Do I need to be an experienced devops to create a micro-service based application?
50-
- Wouldn't it be nice to develop a plain database/backend/frontend application without infrastructure boilerplate but still be able to configure everything I want when needed?
51-
- How to run batch operations like ETL processes easily and efficiently in a cloud environment?
52-
- How to manage databases without being locked to a specific vendor solution?
53-
- How to perform database backups?
54-
- How to manage secret data?
55-
- What about having a precounfigured account management application?
56-
- Sooner rather than later I'll need an orchestration queue. Why not have that just ready to use?
50+
51+
- How do I create a deployment for my microservices?
52+
- How do I orchestrate my microservices?
53+
- How to create consistent api documentation?
54+
- Do I need to be an experienced devops to create a micro-service based application?
55+
- Wouldn't it be nice to develop a plain database/backend/frontend application without infrastructure boilerplate but still be able to configure everything I want when needed?
56+
- How to run batch operations like ETL processes easily and efficiently in a cloud environment?
57+
- How to manage databases without being locked to a specific vendor solution?
58+
- How to perform database backups?
59+
- How to manage secret data?
60+
- What about having a precounfigured account management application?
61+
- Sooner rather than later I'll need an orchestration queue. Why not have that just ready to use?
5762

5863
# Command line tools
5964

@@ -63,30 +68,34 @@ CloudHarness provides the following command line tools to help application scaff
6368
* `harness-application` - create a new CloudHarness REST application.
6469
* `harness-generate` - generates server and client code for all CloudHarness REST applications.
6570
* `harness-test` - run end to end tests
66-
71+
6772
# Get started
6873

6974
## Prerequisites
7075

7176
### Operative system
7277

7378
Cloudharness can be used on all major operative systems.
79+
7480
- Linux: supported and tested
7581
- MacOS: supported and tested
7682
- Windows/WSL2: supported and tested
7783
- Windows native: mostly working, unsupported
7884

7985
### Python
80-
Python 3.9 must be installed.
86+
87+
Python 3.10 must be installed.
8188

8289
It is recommended to setup a virtual environment.
8390
With conda:
91+
8492
```bash
85-
conda create --name ch python=3.12
93+
conda create --name ch python=3.10
8694
conda activate ch
8795
```
8896

8997
### Docker
98+
9099
[Docker](https://www.docker.com) is required to build locally.
91100

92101
### Kubernetes command line client
@@ -110,6 +119,7 @@ conda activate ch
110119
A node environment with npm is required for developing web applications and to run end to end tests.
111120

112121
Recommended:
122+
113123
- node >= v14.0.0
114124
- npm >= 8.0.0
115125

@@ -120,26 +130,183 @@ A JRE is needed to run the code generators based on openapi-generator.
120130
For more info, see [here](https://openapi-generator.tech/docs/installation).
121131

122132
## CloudHarness command line tools
133+
123134
To use the cli tools, install requirements first:
124135

125136
```bash
126137
bash install.sh
127138
```
128-
### Generate deployment
129-
130-
To generate a deployment, run `harness-deployment`. See [below](#Deployment) for more.
131139

132140
### Create new REST application
133-
To create a new REST application, run `harness-application` from the root of your solution.
141+
142+
`harness-application` is a command-line tool used to create new applications based on predefined code templates. It allows users to quickly scaffold applications with backend, frontend, and database configurations.
143+
144+
#### harness-application Usage
145+
146+
```sh
147+
harness-application [name] [-t TEMPLATE]
148+
```
149+
150+
#### harness-application Arguments
151+
152+
- `name` *(required)* – The name of the application to be created.
153+
154+
#### harness-application Options
155+
156+
- `-h, --help` – Displays the help message and exits.
157+
- `-t TEMPLATES, --template TEMPLATES` – Specifies one or more templates to use when creating the application.
158+
159+
#### Available Templates
160+
161+
The following templates can be used with the `-t` flag:
162+
163+
- **flask-server** – Backend Flask server based on OpenAPI.
164+
- **webapp** – Full-stack React web application with both frontend and backend.
165+
- **db-postgres** – PostgreSQL database setup.
166+
- **db-neo4j** – Neo4j database setup.
167+
- **db-mongo** – MongoDB database setup.
168+
- **django-fastapi** – FastAPI and Django backend based on OpenAPI.
169+
- **django-ninja** – Django Ninja backend.
170+
171+
#### harness-application Examples
172+
173+
##### Create a New Flask-Based Microservice Application
174+
175+
```sh
176+
harness-application myapp
177+
```
178+
179+
##### Create a Full-Stack Web Application
180+
181+
```sh
182+
harness-application myapp -t webapp
183+
```
184+
185+
##### Create a Web Application with Mongo Database
186+
187+
```sh
188+
harness-application myapp -t webapp -t db-mongo
189+
```
190+
191+
##### Display Help Information
192+
193+
```sh
194+
harness-application --help
195+
```
196+
197+
#### harness-application Notes
198+
199+
- Multiple templates can be specified concatenating the -t parameter.
200+
- The tool generates the necessary scaffolding for the chosen templates.
201+
- Ensure you have the required dependencies installed before running the generated application.
202+
- For more information, run `harness-application --help` or check out the additional documentation:
203+
- [Applications README](./docs/applications/README.md)
204+
- [Developer Guide](./docs/dev.md)
134205

135206
### Generate server and client code from openapi
136-
To (re)generate the code for your applications, run `harness-generate` from the root.
137-
The script will look for all openapi applications, and regenerate the Flask server code and documentation.
138-
Note: the script will eventually override any manually modified file. To avoid that, define a file openapi-generator-ignore.
207+
208+
To (re)generate the code for your applications, run `harness-generate`.
209+
`harness-generate` is a command-line tool used to generate client code, server stubs, and model libraries for applications. It walks through the filesystem inside the `./applications` folder to create and update application scaffolding. The tool supports different generation modes and allows for both interactive and non-interactive usage.
210+
211+
#### Usage
212+
213+
```sh
214+
harness-generate [mode] [-h] [-i] [-a APP_NAME] [-cn CLIENT_NAME] [-t | -p] [path]
215+
```
216+
217+
#### harness-generate Arguments
218+
219+
- `path` *(optional)* – The base path of the application. If provided, the `-a/--app-name` flag is ignored.
220+
221+
#### harness-generate Options
222+
223+
- `-h, --help` – Displays the help message and exits.
224+
- `-i, --interactive` – Asks for confirmation before generating code.
225+
- `-a APP_NAME, --app-name APP_NAME` – Specifies the application name to generate clients for.
226+
- `-cn CLIENT_NAME, --client-name CLIENT_NAME` – Specifies a prefix for the client name.
227+
- `-t, --ts-only` – Generates only TypeScript clients.
228+
- `-p, --python-only` – Generates only Python clients.
229+
230+
#### Generation Modes
231+
232+
`harness-generate` supports the following modes:
233+
234+
- **all** – Generates both server stubs and client libraries.
235+
- **clients** – Generates only client libraries.
236+
- **servers** – Generates only server stubs.
237+
- **models** – Regenerates only model libraries.
238+
239+
#### harness-generate Examples
240+
241+
##### Generate Client and Server stubs for all applications
242+
243+
```sh
244+
harness-generate all
245+
```
246+
247+
##### Generate Client and Server stubs for a Specific Application
248+
249+
```sh
250+
harness-generate all -a myApp
251+
```
252+
253+
##### Generate Only Client Libraries
254+
255+
```sh
256+
harness-generate clients
257+
```
258+
259+
##### Generate Only Server Stubs
260+
261+
```sh
262+
harness-generate servers
263+
```
264+
265+
##### Regenerate Only Model Libraries (deprecated)
266+
267+
```sh
268+
harness-generate models
269+
```
270+
271+
##### Generate TypeScript Clients Only and Server stubs
272+
273+
```sh
274+
harness-generate all -t
275+
```
276+
277+
##### Generate Python Clients Only and Server stubs
278+
279+
```sh
280+
harness-generate all -p
281+
```
282+
283+
##### Interactive Mode
284+
285+
```sh
286+
harness-generate all -i
287+
```
288+
289+
#### harness-generate Notes
290+
291+
- The tool scans the `./applications` directory for available applications.
292+
- If `path` is provided, `-a/--app-name` is ignored.
293+
- The `models` mode is a special flag used when regenerating only model libraries (deprecated).
294+
- The tool supports interactive mode to confirm before generating clients.
295+
- Use either `-t` or `-p`, but not both simultaneously.
296+
297+
For further details, run:
298+
299+
```sh
300+
harness-generate --help
301+
```
302+
303+
### Generate deployment
304+
305+
To generate a deployment, run `harness-deployment`. See [below](#build-and-deploy) for more information.
139306

140307
# Extend CloudHarness to build your project
141308

142-
CloudHarness is born to be extended.
309+
CloudHarness is born to be extended.
143310

144311
The quickest way to start is to install Cloud Harness, copy the *blueprint* folder and build from that with the cli tools, such as
145312
`harness-application`, `harness-generate`, `harness-deployment`.
@@ -150,10 +317,11 @@ See the [developers documentation](docs/dev.md#start-your-project) for more info
150317

151318
The script `harness-deployment` scans your applications and configurations to create the build and deploy artifacts.
152319
Created artifacts include:
153-
- Helm chart (or docker compose configuration file)
154-
- Skaffold build and run configuration
155-
- Visual Studio Code debug and run configuration
156-
- Codefresh pipeline yaml specification (optional)
320+
321+
- Helm chart (or docker compose configuration file)
322+
- Skaffold build and run configuration
323+
- Visual Studio Code debug and run configuration
324+
- Codefresh pipeline yaml specification (optional)
157325

158326
With your project folder structure looking like
159327

@@ -193,5 +361,4 @@ Then, you can selectively add files related to configuration that you want to pe
193361

194362
For more information about how to configure a deployment, see [here](./build-deploy/helm-configuration.md)
195363

196-
197-
[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/tarelli/Cloudharness%2Funittests?type=cf-1&key=eyJhbGciOiJIUzI1NiJ9.NWFkNzMyNDIzNjQ1YWMwMDAxMTJkN2Rl.-gUEkJxH6NCCIRgSIgEikVDte-Q0BsGZKEs4uahgpzs)]( https://g.codefresh.io/pipelines/edit/new/builds?id=6034cfce1036693697cd602b&pipeline=unittests&projects=Cloudharness&projectId=6034cfb83bb11c399e85c71b)
364+
[![Codefresh build status](https://g.codefresh.io/api/badges/pipeline/tarelli/Cloudharness%2Funittests?type=cf-1&key=eyJhbGciOiJIUzI1NiJ9.NWFkNzMyNDIzNjQ1YWMwMDAxMTJkN2Rl.-gUEkJxH6NCCIRgSIgEikVDte-Q0BsGZKEs4uahgpzs)](https://g.codefresh.io/pipelines/edit/new/builds?id=6034cfce1036693697cd602b&pipeline=unittests&projects=Cloudharness&projectId=6034cfb83bb11c399e85c71b)

0 commit comments

Comments
 (0)