Skip to content

nguyenvanphong2410/plant_ui

Repository files navigation

Base ExpressJS

Base ExpressJS is a basic source code, using Express FrameWork

Requirements

  • node ~ v18.19.0
  • npm ~ v10.2.3

Usage

  1. Clone project
  2. Create .env file, copy content from .env.example to .env file and config in .env:
  • Config Runtime Environment
# development or production
NODE_ENV=development
HOST=localhost
PORT=3456
  • Config Project
APP_NAME=ExpressJS
APP_DEBUG=true
# server domain name
APP_URL_API=http://localhost:3456
# primary client domain name
APP_URL_CLIENT=http://localhost:3000
# other client domain name
# Eg: ["http://localhost:3001", "http://localhost:3002"]
OTHER_URLS_CLIENT=
# primary secret key
SECRET_KEY=
# expressed in seconds or a string describing a time span
# Eg: 60, 2 days, 10h, 7d
JWT_EXPIRES_IN=7d
# maximum number of requests per minute
REQUESTS_LIMIT_PER_MINUTE=100
  • Config MongoDb Database
DB_HOST=localhost
DB_PORT=27017
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
  • Config Email
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
[email protected]
MAIL_FROM_NAME=
  1. Install package & setup
npm install
  1. Initialize data (Required for new database)
npm run seed

Note: By default we will use this account as the Super Admin. If you want to change it, please set two environment variables SUPER_ADMIN_EMAIL and SUPER_ADMIN_PASSWORD.

  1. Runs the app
npm run start
  1. Builds the app for production to the build folder
npm run build
  1. Runs the app on production mode
node build/main.js

Note: remember set NODE_ENV=production in .env file

Default account

Credits

ZentSoft.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published