Skip to content

Commit 18b2296

Browse files
committed
Update README.md
1 parent 9f0d51c commit 18b2296

File tree

1 file changed

+52
-34
lines changed

1 file changed

+52
-34
lines changed

README.md

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,72 @@
1-
# tinystruct maven archetype
1+
# Kickstart your tinystruct project using the tinystruct-archetype
2+
3+
*A simple way to bootstrap applications with tinystruct 1.7.11*
4+
5+
If you're building an application with the **tinystruct** framework, the easiest way to begin is by using the **tinystruct-archetype**, now available on **Maven Central**.
6+
It gives you a clean, fully prepared project structure with zero manual setup.
7+
8+
## 🌟 Why Use tinystruct-archetype?
9+
10+
### **1. Instant Project Generation**
11+
12+
One command creates a complete tinystruct application with the correct `pom.xml`, directory layout, and starter code.
13+
14+
### **2. Clean, Consistent Structure**
15+
16+
Your project is generated with tinystruct’s recommended conventions:
17+
18+
* `AbstractApplication` as the base
19+
* `@Action` for defining routes
20+
* Ready to run via CLI or as an HTTP service
21+
* No boilerplate or extra configuration needed
22+
23+
### **3. Built for tinystruct 1.7.11**
24+
25+
Select the version you want (e.g., `1.7.11`), and it's applied automatically.
26+
27+
### **4. No Repo Clone Needed**
28+
29+
Because the archetype is published on Maven Central, you can use it immediately.
30+
31+
---
32+
33+
## 🚀 Generate a tinystruct Project (Maven Central)
34+
35+
Simply run:
236

3-
This archetype creates a minimal tinystruct application.
4-
## Quick usage
537
```cmd
638
mvn archetype:generate -DarchetypeGroupId="org.tinystruct" -DarchetypeArtifactId="tinystruct-archetype" -DarchetypeVersion="1.0.1" -DgroupId="com.mycompany" -DartifactId="my-tiny-app" -Dpackage="com.mycompany.app" -DtinystructVersion="1.7.11" -DinteractiveMode="false"
739
```
840

9-
## Usage with installing the archetype locally
41+
This creates your new project instantly.
1042

11-
1. Install the archetype into your local Maven repository:
43+
---
1244

13-
```cmd
14-
mvn clean install
45+
## 🛠 Build Your Project
46+
47+
```bash
48+
cd my-tinystruct-app
49+
mvn clean package
1550
```
1651

17-
2. Generate a new project from the archetype (example):
52+
---
1853

19-
```cmd
20-
mvn archetype:generate \
21-
-DarchetypeCatalog="local" \
22-
-DarchetypeGroupId="org.tinystruct" \
23-
-DarchetypeArtifactId="tinystruct-archetype" \
24-
-DarchetypeVersion="1.0.1" \
25-
-DgroupId="com.mycompany" \
26-
-DartifactId="my-tiny-app" \
27-
-Dpackage="com.mycompany.app" \
28-
-DtinystructVersion="1.7.11"
29-
```
54+
## ▶️ Run Your tinystruct Application
3055

31-
3. Build the generated project:
56+
Since tinystruct now uses **HttpServer** as the default HTTP server, the run command becomes:
3257

33-
```cmd
34-
cd my-tiny-app
35-
mvn clean package
58+
```bash
59+
bin/dispatcher start \
60+
--import org.tinystruct.system.HttpServer \
61+
--import com.example.app.Application
3662
```
3763

64+
Your tinystruct service is now up and running.
65+
3866
Adjust `tinystructVersion` if needed. The generated project includes a simple `Application` that extends `AbstractApplication` with a sample `hello` action.
3967

4068
## Notes
4169

4270
- **Java version:** this archetype targets Java 17 by default (see `archetype-resources/pom.xml`). Ensure you have JDK 17+ installed.
4371
- **CI:** a sample GitHub Actions workflow is included to build and test the generated projects on push/PR (`.github/workflows/maven.yml`).
44-
- **Maven Wrapper:** consider adding the Maven Wrapper (`mvnw`) to this repository so contributors can build without installing Maven globally.
45-
46-
## Quick tips
47-
48-
- To run tests in a generated project use:
49-
50-
```cmd
51-
mvn test
52-
```
53-
54-
- If you plan to publish the archetype, set `tinystructVersion` to a released version and test generation in a clean directory.
72+
- **Maven Wrapper:** consider adding the Maven Wrapper (`mvnw`) to this repository so contributors can build without installing Maven globally.

0 commit comments

Comments
 (0)