You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-158Lines changed: 6 additions & 158 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,13 +84,13 @@ Cloudharness can be used on all major operative systems.
84
84
85
85
### Python
86
86
87
-
Python 3.10 must be installed.
87
+
Python 3.10+ must be installed.
88
88
89
89
It is recommended to setup a virtual environment.
90
90
With conda:
91
91
92
92
```bash
93
-
conda create --name ch python=3.10
93
+
conda create --name ch python=3.12
94
94
conda activate ch
95
95
```
96
96
@@ -137,168 +137,16 @@ To use the cli tools, install requirements first:
137
137
bash install.sh
138
138
```
139
139
140
-
### Create new REST application
140
+
### Create a new REST application
141
141
142
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:
More information can be found [here](./docs/applications/harness-application.md).
205
144
206
145
### Generate server and client code from openapi
207
146
208
147
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.
# Use harness-application to create a new application from templates
1
+
# Use harness-application to create a new application
2
2
3
-
## Choosing Templates
3
+
## Overview
4
4
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.
6
6
7
-
Running `harness-application --help` will list the currently available templates:
7
+
## Usage
8
8
9
+
```sh
10
+
harness-application [name] [-t TEMPLATE]
9
11
```
10
-
usage: harness-application [-h] [-t TEMPLATES] name
11
12
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
13
23
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:
16
25
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
21
28
```
22
29
23
30
## Available Templates
24
31
25
32
### Base
26
33
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.
28
55
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
33
57
58
+
#### Webapp
34
59
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.
36
63
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
40
65
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.
41
69
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
+
```
43
95
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
48
97
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:
0 commit comments