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

Commit b605e54

Browse files
committed
update local dev docs
1 parent a8e2359 commit b605e54

File tree

4 files changed

+69
-108
lines changed

4 files changed

+69
-108
lines changed

docs/basics/local-dashboard.mdx

Lines changed: 0 additions & 55 deletions
This file was deleted.

docs/basics/local-development.mdx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
description: 'Local development with Nitric'
3+
---
4+
5+
# Local Development
6+
7+
One of the key features of Nitric is the ability to run your application locally for development and testing, using an environment that closely resembles how the application would run in the cloud.
8+
9+
Using the `nitric start` command, you can start a local environment with local versions of the services/resources your application depends on. For example, Nitric can emulate API and websocket gateways, trigger scheduled services, and provide runtime APIs for queues, buckets, secrets, key/value stores, etc.
10+
11+
The `start` command runs your code without containerization, making it easier to debug and test your application locally. This is the recommended way to run your application during development. However, if you prefer to run your application in containers, you can use the `nitric run` command.
12+
13+
## Running locally
14+
15+
```bash
16+
nitric start
17+
```
18+
19+
Once the command starts, you'll be presented with a list of running APIs and other services. You'll also see a link to the [local development dashboard](#local-dashboard) where you can view a live architecture diagram of your running application and interact with various services for testing.
20+
21+
<img
22+
src="/docs/images/docs/dashboard-architecture.png"
23+
style={{ maxWidth: 800, width: '100%' }}
24+
alt="screen shot of the local development dashboard"
25+
/>
26+
27+
## Running locally in Containers
28+
29+
If you prefer to run your application in containers, you can use the `nitric run` command. This command builds and runs your application in Docker containers (one per service), along with any other services it depends on. This is useful for testing your application in an environment that closely resembles how it would run in the cloud.
30+
31+
However, running your application in containers can make it slightly harder attach debuggers and on operating systems like Windows and MacOS, the startup time can be slower due to the overhead of running the containers in a virtual machine.
32+
33+
```bash
34+
nitric run
35+
```
36+
37+
## Enabling local HTTPS
38+
39+
By default, Nitric runs your application's APIs and HTTP Proxies over HTTP to avoid common issues with self-signed certificates. In most cases, this is sufficient for local development. However, if you need to test your application with HTTPS, the `nitric start` command supports enabling HTTPS using the `--https-preview` flag.
40+
41+
This command will generate a self-signed certificate and key for your application and use them to serve your application over HTTPS. Keep in mind that self-signed certificates are not trusted by browsers and may cause security warnings.
42+
43+
```bash
44+
nitric start --https-preview
45+
```
46+
47+
If you need to use a custom certificate and key, you can place them in the `.nitric/tls` directory in your project and Nitric will use them to serve your application over HTTPS. The files must be named `cert.pem` and `key.pem` respectively.
48+
49+
<Note>This feature is experimental and may change in future releases.</Note>
50+
51+
## Local Dashboard
52+
53+
The Nitric CLI also hosts a Local Development Dashboard, which provides a graphical interface for interacting with your application during development. The dashboard includes the following features:
54+
55+
- Architecture: An automatic architecture visualization of your application, including all services, resources and their connections.
56+
- API Explorer: An automatic HTTP client for testing your APIs.
57+
- Batch jobs: Observe batch service jobs and submit tasks.
58+
- Databases: View your SQL databases and interact with them using SQL queries. This screen can also be used to trigger database migrations.
59+
- Schedules: Trigger and observe scheduled tasks.
60+
- Storage: View your applications buckets and interact with them, including uploading and downloading files.
61+
- Topics: View topics and subscriptions, and publish messages to topics.
62+
- Secrets: View and manage your application secrets.
63+
- WebSockets: Dive deep into connection details, connecting, and sending messages.
64+
65+
Many of these features make it possible to build and testing modules of your application in isolation. For example, you can could create and test a topic and subscriber without needing to first write the publisher.
66+
67+
All features provide real-time updates, ensuring you stay in sync with your application changes.
68+
69+
To access the Development Dashboard open the local URL in your browser. By default, the URL is set to [http://localhost:49152](http://localhost:49152).

docs/configuration.mdx

Whitespace-only changes.

docs/reference/cli/local-development.mdx

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)