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

Commit daa9ef7

Browse files
committed
update the project structure doc
1 parent 469e64b commit daa9ef7

File tree

2 files changed

+61
-35
lines changed

2 files changed

+61
-35
lines changed

docs/basics/project-structure.mdx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
description: 'The structure of a Nitric project'
3+
---
4+
5+
# Project structure
6+
7+
Nitric doesn't enforce a strict project structure. By default, Nitric only requires a `nitric.yaml` file to identify the project and a `nitric.[stack ID].yaml` file to define the deployment target. However, Nitric projects can be organized in a way that makes sense for you or your team.
8+
9+
We recommend starting with a project template, using the `nitric new` CLI command. These templates often contain an opinionated project structure, to get you started quickly. You can then modify the project structure to suit your needs.
10+
11+
## Basic structure
12+
13+
Here are some examples of basic Nitric project structures:
14+
15+
<CodeWithTabs>
16+
17+
```text !!tabs Go
18+
my-project/
19+
├── nitric.yaml
20+
├── nitric.aws.yaml
21+
└── services/
22+
├── service1/
23+
│ └── main.go
24+
└── service2/
25+
└── main.go
26+
```
27+
28+
```text !!tabs JavaScript
29+
my-project/
30+
├── nitric.yaml
31+
├── nitric.aws.yaml
32+
└── services/
33+
├── service1.js
34+
└── service2.js
35+
```
36+
37+
```text !!tabs Python
38+
my-project/
39+
├── nitric.yaml
40+
├── nitric.aws.yaml
41+
└── services/
42+
├── service1.py
43+
└── service2.py
44+
```
45+
46+
</CodeWithTabs>
47+
48+
This flexibility allows you to organize your project in a way that makes sense for you or your team. For example, you may build a single monolithic service, multiple microservices, or something else entirely.
49+
50+
<Note>
51+
The `services` directory is a common convention for Nitric projects, but you
52+
can organize your project however you like.
53+
</Note>
54+
55+
## Project file
56+
57+
The existence of a `nitric.yaml` file, indicates that the directory contains a project built with Nitric. The file defines the project's name and how to locate and run the entrypoints to your application (services). You can read about the `nitric.yaml` file in the [configuration](/basics/configuration) section.
58+
59+
## Stack files
60+
61+
Nitric projects can be deployed to multiple environments and cloud providers; stack files identify these deployment targets. These files can be created by running the `nitric stack new` CLI command. You can read more about stack files in the [deployment](/basics/deployment) section.

docs/concepts/project-structure.mdx

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

0 commit comments

Comments
 (0)