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
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
description="Learn how to quickly get started with Nitric by exploring tutorials, APIs, and platform resources. Discover how Nitric can empower you to build applications efficiently and effectively."
11
+
description="Build cloud backends that run anywhere, fast."
16
12
/>
17
13
18
-
<GettingStarted />
14
+
Nitric is a cloud framework with common resources like APIs, webhooks, databases, queues, topics, buckets, and more.
19
15
20
-
<Concepts />
16
+
However, Nitric is unique - it doesn't just deploy the resources, it helps you interact with them. It also makes them plugable, so you can swap services or even whole clouds without changing your code.
21
17
22
-
{/* <BuildingBlocks /> */}
18
+
It's what's missing between applications and infrastructure automation.
23
19
24
-
<Libraries />
20
+
Oh, and it supports basically any language, like JavaScript, TypeScript, Python, Go, you name it.
25
21
26
-
<Providers />
22
+
## Services
27
23
28
-
<Community />
24
+
Services are the heart of nitric apps, they're the entrypoints to your code. They can serve as APIs, webhooks, schedule handlers, subscribers and a lot more. You create services by telling Nitric where to look for your code and how to run it.
25
+
26
+
```yaml {{ label:"nitric.yaml" }}
27
+
name: example
28
+
services:
29
+
- match: services/*.ts
30
+
start: npm run dev:services $SERVICE_PATH
31
+
```
32
+
33
+
You might have one service that handles everything, or a service for each route. It's up to you.
34
+
35
+
## Resources
36
+
37
+
Resources are the building blocks of your apps. They're the databases, queues, buckets, etc. that your services interact with. If you want a resource, you just ask for it.
final profiles = Nitric.bucket("profiles").allow([
76
+
BucketPermission.read,
77
+
BucketPermission.write,
78
+
BucketPermission.delete,
79
+
]);
80
+
```
81
+
82
+
</CodeGroup>
83
+
84
+
Nitric collects everything your services request. When you deploy, the deployment plugin you choose creates the resources and services, then links it all together.
85
+
86
+
<Note>
87
+
That probably sounds like magic, but it's more like a compiler for Infrastructure-as-Code - you can read about it in the [Concepts](/docs/concepts) section.
88
+
</Note>
89
+
90
+
## Providers
91
+
92
+
Nitric is designed to be independent of any platform, so you can run your apps anywhere. You can deploy to AWS, Azure, GCP, or even your own Kubernetes cluster. You can even deploy to multiple clouds at once.
93
+
94
+
Seriously, is there really a difference between a bucket on AWS and a bucket on Azure? We doesn't think so. So why is the code different?
95
+
96
+
Nitric abstracts away the differences, so you can focus on your app. The part that makes that possible is a plugin, we call a **Provider**.
We have a few providers built-in with IaC from Pulumi or Terraform, but you can build your own with any tools you prefer and to anywhere you want. You can even deploy to multiple clouds at once.
133
+
134
+
## Projects
135
+
136
+
Projects built with Nitric don't have many restrictions. You can use most languages, most libraries, most tools, most clouds, most services, mostly anything you like. But, you need to have a `nitric.yaml` file in the root of your project.
137
+
138
+
```yaml {{ label:"nitric.yaml" }}
139
+
name: example
140
+
services:
141
+
- match: services/*.ts
142
+
start: npm run dev:services $SERVICE_PATH
143
+
```
144
+
145
+
Nitric uses this to find your services, then it turns each service into a container, runs them in deployment mode to match the resources you requested and gives the result to the Provider - which either generates IaC (like Terraform) or automatically deploys your app.
146
+
147
+
So, a project structure might look something like this:
148
+
149
+
<CodeGroup>
150
+
151
+
```plaintext {{ title:"JavaScript" }}
152
+
example/
153
+
├── nitric.yaml
154
+
├── services/
155
+
│ └── orders.ts
156
+
│ └── users.ts
157
+
└── package.json
158
+
```
159
+
160
+
```plaintext {{ title:"Python" }}
161
+
example/
162
+
├── nitric.yaml
163
+
├── services/
164
+
│ └── orders.py
165
+
│ └── users.py
166
+
└── Pipfile
167
+
```
168
+
169
+
```plaintext {{ title:"Go" }}
170
+
example/
171
+
├── nitric.yaml
172
+
├── services/
173
+
│ ├── orders/
174
+
│ │ └── main.go
175
+
│ └── users/
176
+
│ └── main.go
177
+
├── dockerfile
178
+
└── go.mod
179
+
```
180
+
181
+
```plaintext {{ title:"Dart" }}
182
+
example/
183
+
├── nitric.yaml
184
+
├── services/
185
+
│ └── orders.dart
186
+
│ └── users.dart
187
+
└── pubspec.yaml
188
+
```
189
+
190
+
</CodeGroup>
191
+
192
+
## CLI
193
+
194
+
Nitric has a CLI to help you create, manage, run and deploy your projects. We recommend installing it with a package manager:
You can create a new project from a template with the `new` command.
216
+
217
+
```bash
218
+
nitric new
219
+
```
220
+
221
+
### Start
222
+
223
+
You can run your project locally with the `start` command.
224
+
225
+
```bash
226
+
nitric start
227
+
```
228
+
229
+
<Note>
230
+
Start also emulates the resources you requested, so you can test your app locally. And provides a Dashboard UI to interact with the resources.
231
+
</Note>
232
+
233
+
### Deploy
234
+
235
+
You can deploy your project with the `up` command, once you have a stack file (deployment target).
236
+
237
+
```bash
238
+
nitric stack new
239
+
240
+
nitric up
241
+
```
242
+
243
+
<Note>
244
+
Some providers don't deploy directly, instead they generate IaC files. In those cases you use the IaC tool to deploy (e.g. `terraform apply`).
245
+
</Note>
246
+
247
+
### Tear Down
248
+
249
+
You can tear down your project with the `down` command.
250
+
251
+
```bash
252
+
nitric down
253
+
```
254
+
255
+
## Dashboard
256
+
257
+
Nitric has a local Dashboard UI (hosted by the CLI) to help you interact with your resources. You can typically access it at [http://localhost:49152](http://localhost:49152/).
alt="screen shot of the local development dashboard"
263
+
/>
264
+
265
+
## What now?
266
+
267
+
If you're still not sure what to make of Nitric, maybe start with the [Concepts](/docs/concepts) section, otherwise the best way to learn is to dive into the [Guides](/docs/guides) and start building your first project.
0 commit comments