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
Auth - JWT
Set how long session will expired on the app.
Database
You can use MySql or Postgres database.
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.
Hash ID
Backend server will hashing id from integer to random string. so important to set your salt for hash Ids
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.
Last updated