> For the complete documentation index, see [llms.txt](https://docs.nzoni.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nzoni.app/node.js-mongodb.md).

# Node.js/MongoDB

## **Get Started**

Let's get your SaaS application up and running quickly :

1. **Clone the Project:** Use your GitHub access token to clone the project:

   ```
   git clone https://<your_access_token>@github.com/nzoni-app/nz-nodejs-mongodb.git
   ```
2. **Environment Variables:** Create a `.env` file based on the `.env.example` and fill in the following details:

`DEFAULT_PLAN_ID`: ID of the default plan assigned to new users is necessary

```markdown
ENV=developpement # OR production OR stagging
PORT=3000
# DB configuration
DB_HOST=localhost
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
DB_LOCAL=false

# MAILING
SMTP_HOST=
SMTP_PORT=
SMTP_SECURE=false
SMTP_AUTH=
SMTP_PASSWORD=
SMTP_FROM='"Support name" <support@domain.name>'
MODERATION_MAIL=
# Logs
APP_DEBUG=true
JOB_ERROR_LOG_PATH='./'
DEFAULT_LOG_PATH='./logs'

# JWT
JWT_SECRET=A/iQ2KX0auTZZBwsbPEGC8H3a78HiiL23WD4S+QAoEq34LdeJ9aPrgpHdkkTvBzJ46K2JkM4apkg414erD3S+qLvwiYk3DTorANbbkA+54tVJsXrSGsaUjGifR31OaRK98aDVgICvl60Nymo3+I6527+BOkZalZsbCPzsJ7nALyTNu9Ud2FsvfK0WpAQVOf4teoHT4R/7E7ENChmgHRvI/TWumKfWcyr//Q7b9bLipFivk0EDzkpApdaEsClxE7JjT33aZhMvtuvLn5mQF3L5/ubGs5ZZy+nk4AyhR1DBTYjBYzKoamf94JW3BPobg5heH8gGnNoA+5l3WOJA7uvzw==
JWT_EXPIRATION=192h # 3 days

# FONT_END_URL
FRONT_END_URL=

#GOOGLE
GOOGLE_CLIENT_ID=
GOOGLE_APPLICATION_CREDENTIALS=google-service.json

#STRIPE
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=

#TRIAL PERIOD IF EXIST
TRIAL_DAYS=
DEFAULT_PLAN_ID=
```

* `DATABASE INFOS`: Connection details for your MongoDB database

3. **Install Dependencies:** Navigate to the project directory and install dependencies:

   ```sh
   cd nz-nodejs-mongodb
   npm install
   ```
4. **Start the Application:** Run the following command to start the server:

   ```sh
   npm run start
   ```

This will start the application, and you should be able to access it on the port specified in your configuration (usually [http://localhost:3000](http://localhost:3000/)).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nzoni.app/node.js-mongodb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
