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

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

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

    cd nz-nodejs-mongodb
    npm install
  2. Start the Application: Run the following command to start the server:

    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).

Last updated