API Maker Detailed installation guide for DevOps in server.
Easy installation
- Use below command to easily install the API Maker.
curl -fsSL https://apimaker.dev/v1/install.sh > install.sh && bash install.sh --default --version=latest
- If run above command, no need to do below steps. It will install all dependencies and start all required processes and at the end it will print required URLs and commands.
π οΈ Install Prerequisite Dependencies
- 1CPU | 1GB RAM | 2GB Swap | 25GB Storage VPS with Ubuntu 22.04 LTS
- Install Node.js 18 using NVM
- Install Docker
- Install MongoDB 6 - With Replica Set
- Install Redis 7 - Using Docker Compose
- Oracle Client
  
π Start API Maker Backend
nvm use 18
mkdir -p ~/projects/sava_api_maker
mkdir -p ~/logs
cd ~/projects/sava_api_maker
npm init -y
npm install @sava-info-systems/api-maker
# Normal x64 Windows/Linux/Mac(Intel) Users
npm install [email protected]
# Apple Silicon/ARM architecture processors
npm install oracledb@https://github.com/oracle/node-oracledb/releases/download/v5.5.0/oracledb-src-5.5.0.tgz
# Go to API Maker installation directory
cd ~/projects/sava_api_maker/node_modules/@sava-info-systems/api-maker
# βοΈ Print below file for commands & help in below MongoDB, Redis etc... installation steps
cat ~/projects/sava_api_maker/node_modules/@sava-info-systems/api-maker/assets-deployment/installation_steps.sh
# β  Install MongoDB 6 in replica set
# β  Install Redis 7
# β  Modify .env/package.json file and set MongoDB & Redis endpoints in it, sample .env file is given below
# β  Set Oracle Client in your path if you are going to connect to oracle database.
# ββββ OR ββββ
# β
 npm run install-am-default
# ββββ OR ββββ
# β
 npm run install-am
# -- These "npm run *" commands will install all dependencies and start backend and frontend admin panel no need to execute below commands after that.
npm run set-env-in-fe # Set params from .env/package.json to admin panel frontend in dist folder
# -- This will be done by [npm run install-am-default | npm run install-am] commands
# Start API Maker backend service.
node main.js
# ββββ OR ββββ
# npm run start-forever
# npm run stop-forever
π Start API Maker Admin Frontend
nvm use 18
npm install -g [email protected]
cd ~/projects/sava_api_maker/node_modules/@sava-info-systems/api-maker/dist
# Serve static content of dist folder
ws --spa index.html --port 4626
π₯οΈ Minimum Server Requirement
π Sample .env
# You can set environment variables in this file to override package.json "am" object values.
# Docs Link : https://www.npmjs.com/package/dotenv/v/16.0.3
# Do not remove below environment variables.
NODE_PRESERVE_SYMLINKS=1
NODE_ENV=production
# API Maker admin panel frontend will try to connect to backend on this host and "am__port" will be appended automatically.
BE_HOST_PORT="http://__ip_address__:38246" # π http://127.0.0.1:38246 or https://example.com
# Required environment variables. You can set them in package.json also and remove from here.
am__serverName="server1" # To go inside the object in package.json am, you can use "__" double underscore.
am__processTitle="api_maker_be"
am__port="38246" # π API Maker backend will start on this port
am__wsPort="38245" # π API Maker WebSocket server will start on this port
am__cpuCount=1
#                                  __mongo_user__     __mongo_pass__         __mongo_port__
#        MONGODB                      π(user)           π(pass)   π(IP)   π(port)
am__mongo_db_connection="mongodb://mongo_user:[email protected]:38248/api_maker_db?authSource=admin&replicaSet=rs0&directConnection=true" # π Set this
am__passJWT="syamoyfmtjlfxsrlotgzyhhepddmifts" # π Set this random
am__passDBEncryptDecrypt="syamoyfmtjlfxsrlotgzyhhepddmifts" # π Set this random of 32 characters, it is used to encrypt/decrypt database & repository data.
#                                 __redis_port__                      __redis_pass__
#                                   π(port)       π(IP)                  π(pass)
am__redisInternal='{"nodes": [{port:7479, host:"127.0.0.1", pass: "eUtRxLomuV__rj4KEsb7"}]}' # π Set this
# π Below is external redis value. You can remove it, you can set it from root user settings.
am__redisExternal='{"nodes": [{port:7479, host:"127.0.0.1", pass: "eUtRxLomuV__rj4KEsb7"}], redisValueExpireInSeconds: 7200, maxCharsResToCache: 1000000}'
# π Below is mongodb logs connection value. You can remove it, you can set it from root user settings.
#                                           __mongo_user__  __mongo_pass__             __mongo_port__
#                                               π(user)    π(pass)            π(IP)  π(port)
am__logs__mongo_db_connection_logs="mongodb://mongo_user:[email protected]:38248/api_maker_logs?authSource=admin&replicaSet=rs0&directConnection=true"
# π Automatically set from download. β οΈTake it from downloaded api_maker_be
am__passCommunication="Homi2F4jPxd__hsLdcse"
package.json Configurations In More Detail