Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh documentation #693

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/get-started/foundations/projects/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Here are some examples of basic Nitric project structures:

<TabItem label="JavaScript">

```text JavaScript
```text
my-project/
├── nitric.yaml
├── nitric.aws.yaml
Expand All @@ -41,7 +41,7 @@ my-project/

<TabItem label="TypeScript">

```text JavaScript
```text
my-project/
├── nitric.yaml
├── nitric.aws.yaml
Expand All @@ -54,7 +54,7 @@ my-project/

<TabItem label="Python">

```text Python
```text
my-project/
├── nitric.yaml
├── nitric.aws.yaml
Expand All @@ -67,7 +67,7 @@ my-project/

<TabItem label="Go">

```text Go
```text
my-project/
├── nitric.yaml
├── nitric.aws.yaml
Expand Down
34 changes: 17 additions & 17 deletions docs/get-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Navigate to the new project directory and install the dependencies:

<TabItem label="TypeScript">

```bash TypeScript
```bash
cd hello-world

npm install
Expand All @@ -104,7 +104,7 @@ npm install

<TabItem label="JavaScript">

```bash JavaScript
```bash
cd hello-world

npm install
Expand All @@ -114,7 +114,7 @@ npm install

<TabItem label="Python">

```bash Python
```bash
cd hello-world

uv sync
Expand All @@ -131,7 +131,7 @@ If there are other dependency managers you would like to see supported, please l

<TabItem label="Go">

```bash Go
```bash
cd hello-world

go mod tidy
Expand All @@ -141,7 +141,7 @@ go mod tidy

<TabItem label="Dart">

```bash Dart
```bash
cd hello-world

dart pub get
Expand All @@ -157,9 +157,9 @@ Your project should now look like this:

<TabItem label="TypeScript">

```txt TypeScript
```txt
+--services/
| +-- hello.ts
| +-- api.ts
+--node_modules/
| ...
+--package-lock.json
Expand All @@ -172,9 +172,9 @@ Your project should now look like this:

<TabItem label="JavaScript">

```txt JavaScript
```txt
+--services/
| +-- hello.js
| +-- api.js
+--node_modules/
| ...
+--package-lock.json
Expand All @@ -187,7 +187,7 @@ Your project should now look like this:

<TabItem label="Python">

```txt Python
```txt
+--services/
| +-- api.py
+--.env
Expand All @@ -204,7 +204,7 @@ Your project should now look like this:

<TabItem label="Go">

```txt Go
```txt
+--services/hello/
| +-- main.go
+--go.mod
Expand All @@ -218,9 +218,9 @@ Your project should now look like this:

<TabItem label="Dart">

```txt Dart
```txt
+--services/
| +-- hello.dart
| +-- api.dart
+--analysis_options.yaml
+--pubspec.lock
+--pubspec.yaml
Expand Down Expand Up @@ -270,7 +270,7 @@ Start by opening the `hello` service in your editor and adding a new route to th

<CodeSwitcher tabs>

```typescript !! title:services/hello.ts
```typescript !! title:services/api.ts
import { api } from '@nitric/sdk'

const helloApi = api('main')
Expand All @@ -289,7 +289,7 @@ helloApi.get('/goodbye/:name', async (ctx) => {
})
```

```javascript !! title:services/hello.js
```javascript !! title:services/api.js
import { api } from '@nitric/sdk'

const helloApi = api('main')
Expand All @@ -308,7 +308,7 @@ helloApi.get('/goodbye/:name', async (ctx) => {
})
```

```python !! title:services/hello.py
```python !! title:services/api.py
from nitric.resources import api
from nitric.application import Nitric

Expand Down Expand Up @@ -357,7 +357,7 @@ func main() {
}
```

```dart !! title:services/hello.dart
```dart !! title:services/api.dart
import 'package:nitric_sdk/nitric.dart';

void main() {
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/dart/flutter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ code word_generator

Let's start by building out the backend. This will be an API with a route dedicated to getting a list of all the favorites and a route to toggle a favorite on or off. These favorites will be stored in a [key value store](/keyvalue). To create a Nitric project add the `nitric.yaml` to the Flutter template project.

```yaml {{ label: "nitric.yaml" }}
```yaml title:nitric.yaml
name: word_generator
services:
- match: lib/services/*.dart
Expand Down Expand Up @@ -1414,7 +1414,7 @@ nitric stack new dev aws

You'll then need to edit the `nitric.dev.yaml` file to add a region.

```yaml {{ label: "nitric.dev.yaml" }}
```yaml title:nitric.dev.yaml
provider: nitric/aws@1.11.1
region: us-east-1
```
Expand All @@ -1428,7 +1428,7 @@ Because we've mixed Flutter and Dart dependencies, we need to use a [custom cont
Flutter application, this step is unnecessary.
</Note>

```yaml {{ label: "nitric.yaml" }}
```yaml title:nitric.yaml
name: word_generator
services:
- match: lib/services/*.dart
Expand All @@ -1442,7 +1442,7 @@ runtimes:

Create the Dockerfile at the same path as your runtime specifies. This Dockerfile is fairly straightforward, taking its

```dockerfile {{ label: "docker/flutter.dockerfile" }}
```dockerfile title:docker/flutter.dockerfile
FROM dart:stable AS build

# The Nitric CLI will provide the HANDLER arg with the location of our service
Expand Down Expand Up @@ -1487,7 +1487,7 @@ ENTRYPOINT ["/app/bin/main"]

We can also add a `.dockerignore` to optimize our image further:

```txt {{ label: "docker/flutter.dockerignore" }}
```txt title:docker/flutter.dockerignore
build
test

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/jvm/serverless-rest-api-example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ profileApi.get("/profiles/:id/image/download", (ctx) -> {

<TabItem label="Kotlin">

```kotlin Kotlin
```kotlin
profileApi.get("/profiles/:id/image/download") { ctx ->
val id = ctx.req.params["id"]

Expand Down
24 changes: 11 additions & 13 deletions docs/guides/nodejs/byo-database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ languages:
- typescript
- javascript
published_at: 2022-10-13
updated_at: 2024-06-14
updated_at: 2024-12-30
---

# BYO Database

Nitric currently has out of the box **preview** support for [SQL databases](/sql) with AWS, however Nitric allows you to use whatever tooling and ORMs you prefer for directly interfacing with your database. Our recommendation for local development is to set up a container that runs alongside your Nitric processes. For a production environment, you can use any of the database services for your preferred cloud:
Nitric currently has out of the box **preview** support for [PostgreSQL databases](/sql), however Nitric allows you to use whatever tooling and ORMs you prefer for directly interfacing with your database. If you want to use a database that isn't managed by Nitric, we have the following recommendations:

<Note>
You can track the support for relational databases
[here](https://github.com/nitrictech/roadmap/issues/30).
</Note>
- For local development is to set up a container that runs alongside your Nitric processes.
HomelessDinosaur marked this conversation as resolved.
Show resolved Hide resolved
- For a production environment, you can use any of the database services for your preferred cloud:
HomelessDinosaur marked this conversation as resolved.
Show resolved Hide resolved

| | AWS | GCP | Azure |
| ---------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -50,15 +48,15 @@ await client.connect()

To start, make sure you have a `.env` file containing your environment variables.

```
```text title:.env
POSTGRES_USER=root
POSTGRES_PASSWORD=root
POSTGRES_DB=my-database
```

You can then create a docker compose file to simplify running your docker container each time.

```yaml {{ label: "docker-compose.yml" }}
```yaml title:docker-compose.yml
version: '3.6'
services:
postgres:
Expand All @@ -75,7 +73,7 @@ services:

You can add a script to your `package.json` which will run the docker compose file.

```json {{ label: "package.json" }}
```json title:package.json
"scripts": {
"db": "docker compose up --wait"
}
Expand Down Expand Up @@ -115,7 +113,7 @@ con.connect(function (err) {

You can then create a docker compose file to simplify running your docker container each time.

```yaml {{ label: "docker-compose.yml" }}
```yaml title:docker-compose.yml
version: '3.6'
services:
mysql:
Expand All @@ -133,7 +131,7 @@ services:

You can add a script to your `package.json` which will run the docker compose file.

```json {{ label: "package.json" }}
```json title:package.json
"scripts": {
"db": "docker compose up --wait"
}
Expand Down Expand Up @@ -165,7 +163,7 @@ await client.connect()

You can then create a docker compose file to simplify running your docker container each time.

```yaml {{ label: "docker-compose.yml" }}
```yaml title:docker-compose.yml
version: '3.6'
services:
mongodb:
Expand All @@ -182,7 +180,7 @@ services:

You can add a script to your `package.json` which will run the docker compose file.

```json {{ label: "package.json" }}
```json title:package.json
"scripts": {
"db": "docker compose up --wait"
}
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/nodejs/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ Before running the debugger, it's necessary to install the project's dependencie

<TabItem label="npm">

```bash npm
```bash
npm install
```

</TabItem>

<TabItem label="yarn">

```bash yarn
```bash
yarn install
```

</TabItem>

<TabItem label="pnpm">

```bash pnpm
```bash
pnpm install
```

Expand Down
Loading
Loading