Bliss - Dating app
  • Overview
  • Preview
    • Bliss App
    • Admin App
  • Features
    • Bliss App
    • Admin App
  • Instalation
    • Backend
    • Bliss App
    • Admin App
    • Build App
  • Packages
    • Backend
    • App
  • Structure
    • Backend
    • Bliss App
    • Admin App
  • Style of code writing
  • Customize
    • Languages
    • Theme
Powered by GitBook
On this page
  • 1. Configuration
  • 2. Instalation
  1. Instalation

Backend

Here come the steps to create your backends, deploy the API, and get your endpoints

1. Configuration

First, create .env file from .env.example, and fill in the .env.

  • App

Setup your backend host

APP_URL=http://192.168.1.8:5000 
APP_HOST=http://192.168.1.8
  • Auth - JWT

Set how long session will expired on the app.

AUTH_JWT_ACCESS_TOKEN_SECRET=mySecretCode
AUTH_JWT_REFRESH_TOKEN_SECRET=mySecretCode
AUTH_JWT_ACCESS_TOKEN_EXPIRED=1m
AUTH_JWT_REFRESH_TOKEN_EXPIRED=1d
  • Database

You can use MySql or Postgres database.

DB_CONNECTION=mysql
DB_HOST=localhost 
DB_PORT=3306 
DB_NAME=
DB_USERNAME=root
DB_PASSWORD= 
  • Media Storage

Media can be stored to local storage or firebase storage depends on your configuration. if you want to store to local storage then, you must set MEDIA_STORAGE=local, and set local directory name MEDIA_LOCAL_STORAGE_DIR_NAME=storage .

If you prefer stored media to firebase storage, then first, create your firebase project and download your service account.json and convert to base64 string and set to FIREBASE_SERVICE_ACCOUNT_BASE64= , also set firebase bucket FIREBASE_STORAGE_BUCKET=gs://xxxxxx.appspot.com then setup MEDIA_STORAGE=firebase.

  • Mail

Set your smpt mail server.

MAIL_HOST=  #example: smtp.gmail.com
MAIL_PORT=587 
MAIL_USERNAME=
MAIL_PASSWORD=
  • Hash ID

Backend server will hashing id from integer to random string. so important to set your salt for hash Ids

HASHIDS_SALT=mysaltids

2. Instalation

After create .env and fill it, next step is run npm install on your terminal and npm run dev for development or npm run start for production, and your backend server apis is ready to used.

PreviousInstalationNextBliss App

Last updated 1 year ago

Noted: The backend server using boilerplate from , check the documentation if you want to customize the backend server like create Models, Request, Rules, Resources, Mails, etc with cli commands.

nodemi