Skip to content

Commit 6eeaf32

Browse files
committed
documentation edits
1 parent 2d03fd8 commit 6eeaf32

File tree

3 files changed

+183
-189
lines changed

3 files changed

+183
-189
lines changed

README.md

Lines changed: 6 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ Cloudharness can be used on all major operative systems.
8484

8585
### Python
8686

87-
Python 3.10 must be installed.
87+
Python 3.10+ must be installed.
8888

8989
It is recommended to setup a virtual environment.
9090
With conda:
9191

9292
```bash
93-
conda create --name ch python=3.10
93+
conda create --name ch python=3.12
9494
conda activate ch
9595
```
9696

@@ -137,168 +137,16 @@ To use the cli tools, install requirements first:
137137
bash install.sh
138138
```
139139

140-
### Create new REST application
140+
### Create a new REST application
141141

142142
`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)
143+
More information can be found [here](./docs/applications/harness-application.md).
205144

206145
### Generate server and client code from openapi
207146

208147
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-
```
148+
`harness-generate` is a command-line tool used to generate client code, server stubs, and model libraries for applications.
149+
More information can be found [here](./docs/applications/harness-generate.md)
302150

303151
### Generate deployment
304152

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,103 @@
1-
# Use harness-application to create a new application from templates
1+
# Use harness-application to create a new application
22

3-
## Choosing Templates
3+
## Overview
44

5-
If you create a new application, you can choose templates that are used to generate the application scaffold.
5+
`harness-application` is a command-line tool used to create new applications from predefined code templates. It allows users to quickly scaffold applications with backend, frontend, and database configurations.
66

7-
Running `harness-application --help` will list the currently available templates:
7+
## Usage
88

9+
```sh
10+
harness-application [name] [-t TEMPLATE]
911
```
10-
usage: harness-application [-h] [-t TEMPLATES] name
1112

12-
Creates a new Application.
13+
## Arguments
14+
15+
- `name` *(required)* – The name of the application to be created.
16+
17+
## Options
18+
19+
- `-h, --help` – Displays the help message and exits.
20+
- `-t TEMPLATES, --template TEMPLATES` – Specifies one or more templates to use when creating the application.
21+
22+
## Choosing Templates
1323

14-
positional arguments:
15-
name Application name
24+
When creating a new application, you can choose templates that define its structure and components. Running `harness-application --help` will list the currently available templates:
1625

17-
optional arguments:
18-
-h, --help show this help message and exit
19-
-t TEMPLATES, --template TEMPLATES
20-
Add a template name. Available templates: - base (always included) - flask-server (backend flask app based on openapi) - webapp (webapp including backend and frontend) - db-postgres - db-neo4j - db-mongo - django-app (fastapi django backend based on openapi)
26+
```sh
27+
usage: harness-application [-h] [-t TEMPLATES] name
2128
```
2229

2330
## Available Templates
2431

2532
### Base
2633

27-
* The `base` template is always included and used as foundation for any other template.
34+
- The `base` template is always included and serves as the foundation for any other template.
35+
36+
### Backend Templates
37+
38+
#### Flask Server
39+
40+
- The `flask-server` template consists of a backend built using [Flask](https://flask.palletsprojects.com/en/1.1.x/).
41+
- Uses [Connexion](https://github.com/zalando/connexion) to map OpenAPI definitions to Flask routes.
42+
- Served by [Gunicorn](https://gunicorn.org/) with 2 synchronous workers by default.
43+
- Supports customization of the worker count and type.
44+
45+
#### Django
46+
47+
- The `django-fastapi` consists of a backend based on [FastAPI](https://fastapi.tiangolo.com/) and [Django](https://www.djangoproject.com/).
48+
- Uses the [FastAPI code generator](https://github.com/koxudaxi/fastapi-code-generator) to map OpenAPI definitions.
49+
- Served by [Uvicorn](https://www.uvicorn.org/) with 2 workers by default.
50+
- The `django-ninja` consists of a backend based on [Django Ninja](https://django-ninja.dev/)
51+
- Provides automatic OpenAPI schema generation.
52+
- Supports Django's built-in ORM for seamless database integration.
53+
- High performance due to Pydantic-based data validation.
54+
- Simplifies request parsing and authentication.
2855

29-
### Flask Server
30-
* It consists of a single backend, a Python [Flask](https://flask.palletsprojects.com/en/1.1.x/) application.
31-
* The [Connexion](https://github.com/zalando/connexion) library maps the OpenAPI definition to Flask routing.
32-
* Per default, [Gunicorn](https://gunicorn.org/) serves the Flask app with 2 synchronous workers. Depending on the application requirements, you can update the number of workers or choose a different [worker type](https://docs.gunicorn.org/en/stable/design.html).
56+
### Full-Stack Templates
3357

58+
#### Webapp
3459

35-
### Webapp
60+
- The `webapp` template extends the `base` template by adding a [React](https://reactjs.org/) frontend.
61+
- The frontend bundle is served by the Python backend.
62+
- React is used by default, but other frontend technologies can be integrated.
3663

37-
* The `webapp` template consists builds upon the `base` template extends it by a [React](https://reactjs.org/) frontend application.
38-
* The generated frontend bundle is served by the Python backend.
39-
* Per default, React is used as a frontend application, but you are free to choose a different frontend technology.
64+
### Database Templates
4065

66+
- `db-postgres`[PostgreSQL](https://www.postgresql.org/), a relational database.
67+
- `db-neo4j`[Neo4J](https://neo4j.com/), a graph database.
68+
- `db-mongo`[MongoDB](https://www.mongodb.com/), a NoSQL document-based database.
4169

42-
### Databases
70+
## Examples
71+
72+
### Create a New Flask-Based Microservice Application
73+
74+
```sh
75+
harness-application myapp
76+
```
77+
78+
### Create a Full-Stack Web Application
79+
80+
```sh
81+
harness-application myapp -t webapp
82+
```
83+
84+
### Create a Web Application with a Mongo Database
85+
86+
```sh
87+
harness-application myapp -t webapp -t db-mongo
88+
```
89+
90+
### Display Help Information
91+
92+
```sh
93+
harness-application --help
94+
```
4395

44-
Additionally, you can choose one of the following database templates:
45-
* `db-postgres` - [PostgreSQL](https://www.postgresql.org/), a relational database
46-
* `db-neo4j`- [Neo4J](https://neo4j.com/), a graph database
47-
* `db-mongo` - [MongoDB](https://www.mongodb.com/), a NoSQL document-based database
96+
## Notes
4897

49-
### Django
50-
* It consists of a single backend, a Python [FastAPI](https://fastapi.tiangolo.com/) application.
51-
* The [FastAPI code generator](https://github.com/koxudaxi/fastapi-code-generator) maps the OpenAPI definition to FastAPI routing.
52-
* The [Django framework](https://www.djangoproject.com/) encourages rapid development and clean, pragmatic design.
53-
* Per default, [Uvicorn](https://www.uvicorn.org/) serves the FastAPI app with 2 workers. Depending on the application requirements, you can update the number of workers.
98+
- Multiple templates can be specified by concatenating the `-t` parameter.
99+
- The tool generates the necessary scaffolding for the chosen templates.
100+
- Ensure you have the required dependencies installed before running the generated application.
101+
- For more information, run `harness-application --help` or check out the additional documentation:
102+
- [Applications README](./docs/applications/README.md)
103+
- [Developer Guide](./docs/dev.md)

0 commit comments

Comments
 (0)