---
# System prepended metadata

title: Development Environment Setup Instructions

---

# Development Environment Setup Instructions

Use this document to setup the k811 project locally

## 1. Install prerequisites
1. Docker and docker-compose
2. Node.js 16.x

## 2. Setup env files
Add the following files to the respective locations

1. `backend-monorepo/.env`
```bash=
NODE_ENV=development# supported values: development, production
API_HOST=localhost# Remove this on the production as the pods will have their own service names as api hosts
APM_ENV=local

MONGODB_NAME=k8
MONGODB_USER=swn-poc
MONGODB_PASSWORD=swn-poc1234
MONGODB_HOST=0.0.0.0
MONGODB_PORT=27017
MONGODB_PROTOCOL=mongodb

AMQP_PROTOCOL=amqp
AMQP_USERNAME=guest
AMQP_PASSWORD=guest
AMQP_HOST=127.0.0.1
AMQP_PORT=5672
AMQP_VHOST=/
AMQP_HEARTBEAT=600

DIRECTUS_URL=https://directus.uat.wyreless.org
DIRECTUS_TOKEN=R15MNSNyuuaRPs2sy6rTRs9hhNDkKAyz
DIRECTUS_EMAIL=admin@example.com
DIRECTUS_PASSWORD=asdasdasdasdasdasdasd

INFOBIP_API_KEY=asdasdasdasdasdasdasdas

NETCORE_API_KEY=1234567890asdfghjkl
NETCORE_FROM_EMAIL=test@test.com

MOCK_SERVER_HOST=localhost# This becomes 'mock-server' on production
MOCK_API_PORT=5000# Remove this port on the production as the pods will be using 3000 (API_PORT) port only

MOCK_API=true

MOCK_INFOBIP=true
MOCK_NETCORE=true
MOCK_NAMEMATCHER=true
MOCK_AADHAARVAULT=true
MOCK_CKYC=true
MOCK_NCIF=true
MOCK_KOTAKCIBILBRE=true
MOCK_KOTAKCVV=true
MOCK_KOTAKKRA=true
MOCK_KOTAKCSM=true
MOCK_KOTAKDCMS=true
MOCK_KOTAKAPI=true
MOCK_KOTAKUPI=true
MOCK_PAN=true
MOCK_LOCALDB=true
MOCK_TMX=true
MOCK_OTP=true
MOCK_KOTAK_DCMS=true
MOCK_VKYC=true
MOCK_WHATSAPP=true

API_PORT=3000

API_CONTROLLER_PORT_NUMBER=3121# Remove all these service ports on the production as the pods will be using 3000 (API_PORT) port only
ADMIN_SERVICE_PORT_NUMBER=5001
AADHAAR_VAULT_PORT_NUMBER=7013
LEAD_SERVICE_PORT_NUMBER=7014
CKYC_PORT_NUMBER=7015
EMAIL_PORT_NUMBER=7016
KOTAKAPI_PORT_NUMBER=7017
KOTAK_CIBIL_PORT_NUMBER=7018
KOTAK_CSM_PORT_NUMBER=7019
KOTAK_CVV_PORT_NUMBER=7020
KOTAK_DCMS_PORT_NUMBER=7021
KOTAK_KRA_PORT_NUMBER=7022
KOTAK_UPI_PORT_NUMBER=7023
LOCAL_DB_PORT_NUMBER=7024
NAME_CHECK_PORT_NUMBER=7025
NCIF_PORT_NUMBER=7026
OTP_PORT_NUMBER=7027
PAN_PORT_NUMBER=7028
SMS_PORT_NUMBER=7029
TMX_PORT_NUMBER=7030
WHATSAPP_PORT_NUMBER=7031
PRODUCT_DECISIONING_SERVICE_PORT_NUMBER=7050
DEBIT_CARD_SERVICE_PORT_NUMBER=7032
KYC_LEAD_SERVICE_PORT_NUMBER=7033
VKYC_PORT_NUMBER=7034

AADHAAR_CHECKSUMKEY=865743032701
AADHAAR_CHANNEL_ID=8111
AADHAAR_CHANNEL_NAME=811OTP
VENDOR_ID=INT

LOG_LOCATION=/var/log/k811

APM_SERVER_URL=http://localhost:8200

SESSION_SECRET=YJ&g4fqcoOu5Y}q
SESSION_MAX_AGE=259200000000
COOKIE_ALLOWED_DOMAINS=localhost
CORS_ALLOWED_ORIGINS=http://localhost:3000
COOKIE_IS_SECURE_SETTING=false
COOKIE_SAME_SITE_SETTING=lax

CAPTCHA_REQUEST_TIME_FRAME_SECONDS=3600
CAPTCHA_REQUEST_NUM_HITS=5

CAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe

TRACKING_NUMBER_PREFIX=KC
TRACKING_NUMBER_START=10000000
PROSPECT_ID_START=2000000

KYC_TRACKING_NUMBER_PREFIX=VC
KYC_TRACKING_NUMBER_START=100000
KYC_PROSPECT_ID_START=200000

OTP_EXPIRY_TIME_SECONDS=30

MMI_URL=https://apis.mapmyindia.com/advancedmaps/v1
MMI_SECRET=1231wedasdasd
MMI_KEY=rev_geocode

DISABLE_KYC_BROWSER_CHECK=true

#Product decisioning service config
SLEEP_TIME=2000
SITE_NAME_FOR_CIBIL=KOTAK
ACCOUNT_NAME_FOR_CIBIL=GCVD_KOTAK
ACCOUNT_CODE_FOR_CIBIL=R0NWRF9LT1RBSw==
SRCAPPCD=MWF
ENCRYPTION_ALGORITHM=aes-192-cbc
ENCRYPTION_KEY=pomndpwierodncmfhsaentds
SCORE_LOWER_LIMTI=700
NO_OF_DAY_CIBIL_VALID=45
USCC_JOINING_FEE=400
USCC_ANNUAL_FEE=600
DEFAULT_CREDIT_LIMIT=10000
CIBIL_FULL_FILL_OFFER_API_URL=https://10.240.20.225:9906/FulFillOffer
CIBIL_FULL_GET_ASSET_API_URL=https://10.240.20.225:9906/GetCustAssets
CIBIL_FULL_BRE_API_URL=https://10.240.20.225:9360/CC

#Mock pds apis
MOCK_FULLFILL_OFFER=true
MOCK_CUST_ASSET=true
MOCK_BRE=true
CIBIL_CONSENT_MOCK=true
MOCK_CIBIL_SCORE=true
MOCK_COMPANY_MASTER_LIST=true
MOCK_SUBMIT_APP=true
```

2. `customer-onboarding/.env.local`
```bash=
NEXT_PUBLIC_CMS_API_URL=https://directus.uat.wyreless.org
NEXT_PUBLIC_API_URL=http://localhost:3121
NEXT_PUBLIC_ELASTIC_APM_SERVER_URL=http://localhost:8200
NEXT_PUBLIC_RECAPTCHA_ID=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
NEXT_PUBLIC_ELASTIC_APM_ENV=local
NEXT_PUBLIC_DISABLE_AUTO_ROUTING=false
```

## 3. Start docker containers
1. cd into project root
2. run `docker-compose up`

> You can comment out all the monitoring containers in the docker-compose.yml.
> 
> You only need **mongodb** and **rabbitMQ** to work locally

## 4. Start UI server
1. Ensure you've added the above env file to the `customer-onboarding` project
2. `cd customer-onboarding`
3. Install dependencies `yarn`
4. Run in development mode `yarn run dev`

## 5. Start backend services
1. Ensure you've added the backend env file to the `backend-monorepo` project
2. `cd backend-monorepo`
3. Install dependencies `yarn`
4. Start all microservices `yarn run start`
