expresso-macchiato 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/ExpressoMacchiato/ExpressoMacchiato/refs/heads/master/_github_assets/expresso-macchiato.svg" style="height: 220px;" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<!-- ⭐ GitHub Stars -->
|
|
7
|
+
<a href="https://github.com/ExpressoMacchiato/ExpressoMacchiato/stargazers">
|
|
8
|
+
<img src="https://img.shields.io/github/stars/ExpressoMacchiato/ExpressoMacchiato?style=social" alt="GitHub stars" />
|
|
9
|
+
</a>
|
|
10
|
+
<!-- 🐛 Issues aperti -->
|
|
11
|
+
<a href="https://github.com/ExpressoMacchiato/ExpressoMacchiato/issues">
|
|
12
|
+
<img src="https://img.shields.io/github/issues/ExpressoMacchiato/ExpressoMacchiato" alt="GitHub issues" />
|
|
13
|
+
</a>
|
|
14
|
+
<!-- 🔃 Pull Requests -->
|
|
15
|
+
<a href="https://github.com/ExpressoMacchiato/ExpressoMacchiato/pulls">
|
|
16
|
+
<img src="https://img.shields.io/github/issues-pr/ExpressoMacchiato/ExpressoMacchiato" alt="GitHub pull requests" />
|
|
17
|
+
</a>
|
|
18
|
+
<!-- 📦 Ultima Release -->
|
|
19
|
+
<a href="https://github.com/ExpressoMacchiato/ExpressoMacchiato/releases">
|
|
20
|
+
<img src="https://img.shields.io/github/v/release/ExpressoMacchiato/ExpressoMacchiato" alt="GitHub release" />
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="https://img.shields.io/badge/typescript-5.3.3-blue" alt="Typescript" />
|
|
26
|
+
<img src="https://img.shields.io/badge/express-4.18.2-teal" alt="Express" />
|
|
27
|
+
<img src="https://img.shields.io/badge/typeorm-0.3.21-teal" alt="TypeORM" />
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<br>
|
|
32
|
+
<p align="center" style="font-size: 1.2rem;">
|
|
33
|
+
💡 <strong>Check the full documentation</strong><br>
|
|
34
|
+
👉 Visit <a href="https://alessios-books.gitbook.io/expresso-macchiato">expresso-macchiato docs</a> for the full API reference and guides.
|
|
35
|
+
</p>
|
|
36
|
+
<br>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## 🧘 Relax. Let expresso-macchiato handle it.
|
|
40
|
+
Writing a fully operational backend server—with routes, a database, and documentation—shouldn’t feel like crafting a rocket 🚀. With expresso-macchiato, the setup is minimal, the structure is clean, and the flexibility is in your hands.
|
|
41
|
+
|
|
42
|
+
No more boilerplate. No more endless wiring.
|
|
43
|
+
|
|
44
|
+
## 🧩 What is expresso-macchiato?
|
|
45
|
+
expresso-macchiato is a lightweight but powerful Node.js framework built on top of Express and TypeORM. It simplifies the process of:
|
|
46
|
+
|
|
47
|
+
- Creating and exposing RESTful routes from entity definitions.
|
|
48
|
+
- Generating and serving a Swagger schema out of the box.
|
|
49
|
+
- Bootstrapping your entire app (routes, database, sockets, etc.) with a single class.
|
|
50
|
+
|
|
51
|
+
It's designed for developers who want to go from zero to production-ready server in minutes.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Writing this:
|
|
55
|
+
```ts
|
|
56
|
+
export const noteRoutes = new RouterWrapper({
|
|
57
|
+
tag:'note',
|
|
58
|
+
basePath:'/api/note',
|
|
59
|
+
dbRouting:
|
|
60
|
+
{
|
|
61
|
+
entity: Note,
|
|
62
|
+
secure: { user_id: { tokenKey: 'id', methods: "*" } },
|
|
63
|
+
getParameters: [{ in: 'query', like:true, name:'content' }],
|
|
64
|
+
bodyParameters: Swagger.createSchema({ content: { type: 'string', } }),
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
and mounting it to the Starter, you will:
|
|
69
|
+
1. Create dynamic routes for your entity.
|
|
70
|
+
2. Secure them with a token, with eventually some logics to query the db with the decrypted payload
|
|
71
|
+
3. Create the swagger documentation you can access right after.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 🏁 Quick Start
|
|
75
|
+
The fastest way to get started with expresso-macchiato is using the official project scaffolding:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx create-expresso-macchiato
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This command sets up a complete and ready-to-use template, optimized for working with expresso-macchiato.
|
|
82
|
+
|
|
83
|
+
**Why this is the recommended way:**
|
|
84
|
+
1. Preconfigured build system using TSUP.
|
|
85
|
+
2. Includes jwe-token-based authentication and pre-exposed API routes.
|
|
86
|
+
3. Built-in MinIO utility for handling image storage from Docker.
|
|
87
|
+
4. Comes with a Dockerfile and docker-compose setup out of the box.
|
|
88
|
+
5. Includes prefilled .env files and a .gitignore tailored for Node/TypeScript projects.
|
|
89
|
+
|
|
90
|
+
You just need to:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install
|
|
94
|
+
npm run dev
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
And you're good to go! 🎉
|
|
98
|
+
This will:
|
|
99
|
+
* Connect to the database
|
|
100
|
+
* Expose some demo routes
|
|
101
|
+
* Serve auto-generated Swagger docs at /swagger-ui
|
|
102
|
+
|
|
103
|
+
### 🛠️ Manual Installation
|
|
104
|
+
Prefer starting from scratch? You can install expresso-macchiato directly into your own project:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install expresso-macchiato
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> ### 💡 **Read more**
|
|
111
|
+
> ### 👉 For all the methods and correct use, check the [expresso-macchiato docs](https://alessios-books.gitbook.io/expresso-macchiato) for all the reference you need
|
|
112
|
+
|
|
113
|
+
## 🚀 Next Version
|
|
114
|
+
|
|
115
|
+
If you like **expresso-macchiato**, I'm open to contributors and motivated to keep improving the project.
|
|
116
|
+
|
|
117
|
+
### Planned for `v1.0.0`:
|
|
118
|
+
1. ✨ A clean and robust socket implementation (currently in the `develop` branch)
|
|
119
|
+
2. 🔐 Support for multiple authentication strategies in dynamic DB routing (currently only JWE is supported)
|
|
120
|
+
3. 💡 Fresh ideas and contributions from the community!
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
Feel free to open an issue, fork the repo, or start a discussion — let's make expresso-macchiato even better together!
|