Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit c46632c

Browse files
committed
Add local dev and extension sections
1 parent 064b04c commit c46632c

File tree

1 file changed

+94
-4
lines changed

1 file changed

+94
-4
lines changed

src/pages/index.mdx

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export const disableEditGithub = true
1212
description="Build cloud backends that run anywhere, fast."
1313
/>
1414

15+
---
16+
1517
Nitric is a cloud framework with common resources like APIs, websockets, databases, queues, topics, buckets, and more.
1618

1719
However, Nitric is unique - it doesn't just deploy the resources, it helps you interact with them. It also makes them pluggable, so you can swap services or even whole clouds without changing your code.
@@ -24,6 +26,8 @@ Oh, and it supports basically any language, like JavaScript, TypeScript, Python,
2426
<Libraries minimal />
2527
</div>
2628

29+
---
30+
2731
## Services
2832

2933
Services are the heart of Nitric apps, they're the entrypoints to your code. They can serve as APIs, websockets, schedule handlers, subscribers and a lot more. You create services by telling Nitric where to look for your code and how to run it.
@@ -37,6 +41,8 @@ services:
3741
3842
You might have one service that handles everything, or a service for each route. It's up to you.
3943
44+
---
45+
4046
## Resources
4147
4248
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.
@@ -94,6 +100,8 @@ Nitric collects everything your services request. When you deploy, the deploymen
94100
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.
95101
</Note>
96102

103+
---
104+
97105
## Providers
98106

99107
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.
@@ -138,6 +146,8 @@ provider: custom/[email protected]
138146
139147
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.
140148
149+
---
150+
141151
## Projects
142152
143153
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.
@@ -196,6 +206,8 @@ example/
196206

197207
</CodeGroup>
198208

209+
---
210+
199211
## CLI
200212

201213
Nitric has a CLI to help you create, manage, run and deploy your projects. We recommend installing it with a package manager:
@@ -259,19 +271,97 @@ You can tear down your project with the `down` command.
259271
nitric down
260272
```
261273

262-
## Dashboard
274+
---
263275

264-
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/) after running `nitric start` or `nitric run`.
276+
## Local development
277+
278+
Sometimes you just want to run your app locally and we let you do just that. And we don't mean "binds to a cloud environment and syncs your code, but doesn't work without Wifi" local, we mean "runs on your machine, on a desert island" local.
279+
280+
`nitric start` hosts entrypoints like APIs, websockets, and schedules, as well as resources like databases, topics, queues, key/value stores and buckets.
281+
282+
It also provides a Dashboard to interact with your resources, so you can trigger schedules without waiting, or topics without a publisher, or upload test files to a bucket. It even produces a real-time architecture diagram of your services and resources.
265283

266284
<img
267285
src="/docs/images/docs/dashboard-architecture.png"
268286
style={{ maxWidth: 800, width: '100%' }}
269287
alt="screen shot of the local development dashboard"
270288
/>
271289

272-
## Extension
290+
---
291+
292+
## Extension & Escape Hatches
293+
294+
The services of cloud providers are vast, we can't cover everything and we shouldn't. Many services are unique enough that abstraction would be a disservice. Nitric aims to make common "table stakes" services easy to use, but we never want to limit you.
295+
296+
### Runtime
297+
298+
If you need to access a service in a way Nitric doesn't support, you can always use the provider's SDK directly. Code like this will always work:
299+
300+
<CodeGroup>
301+
302+
```javascript
303+
import { S3Client } from '@aws-sdk/client-s3'
304+
305+
const s3 = new S3Client({ region: 'us-east-1' })
306+
307+
const { Contents } = await s3.listObjectsV2({ Bucket: 'my-bucket' })
308+
```
309+
310+
```python
311+
from boto3 import client
312+
313+
s3 = client('s3', region_name='us-east-1')
314+
315+
response = s3.list_objects_v2(Bucket='my-bucket')
316+
```
317+
318+
```go
319+
import (
320+
"context"
321+
322+
"github.com/aws/aws-sdk-go-v2/config"
323+
"github.com/aws/aws-sdk-go-v2/service/s3"
324+
)
325+
326+
cfg, _ := config.LoadDefaultConfig(context.TODO())
327+
client := s3.NewFromConfig(cfg)
328+
329+
output, _ := client.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{
330+
Bucket: aws.String("my-bucket"),
331+
})
332+
```
333+
334+
```dart
335+
import 'package:aws_s3/aws_s3.dart';
336+
337+
final s3 = S3(region: 'us-east-1');
338+
339+
final response = await s3.listObjectsV2(Bucket: 'my-bucket');
340+
341+
print(response.contents);
342+
```
343+
344+
</CodeGroup>
345+
346+
### Overriding
347+
348+
If you need to change how Nitric deploys a resources or how it interacts with a service at runtime, you can [extend or modify a provider](/reference/providers/custom/extend-standard-provider).
349+
350+
<Note>
351+
For example, here's a [project that swaps SNS for EventBridge](https://github.com/jyecusch/iac-ifc-comparison) on AWS.
352+
</Note>
353+
354+
### Full Customization
355+
356+
If you need to deploy to a cloud or new set of services that Nitric doesn't support, you can [build your own provider](/reference/providers/custom/building-custom-provider). This is a bit more advanced, but it's the ultimate escape hatch.
357+
358+
The included providers are written in Go and built using Terraform or Pulumi, but you can use any language or tool you like.
359+
360+
### Additional Resources
361+
362+
If you need to use a service that Nitric doesn't support, you just do that like you always would. Nitric doesn't get in the way of you using the cloud, it just makes it easier.
273363

274-
TODO
364+
---
275365

276366
## What now?
277367

0 commit comments

Comments
 (0)