Create .env file and save on anacleto-backend root.
.env
# environmen## development,test,produtionENV=developmentLOG_DIR=/tmp/logs# Firebase service account JSONFIREBASE_SERIVCE_ACCOUNT={...}# Server listening portPORT=3001# Logs settingsLOGS_MAX_SIZE=20mLOGS_MAX_FILE=1d# Apps## Firebase UID of super admin (they can access all app and all tenants)SUPER_ADMIN=["UDhyadjTgxXIxRRgebGW6k9jbVG2","S6MhvOhlAkad4dpJzqrZOLRoahK2"]## Sync folderGIT_SYNC_DIR=/Users/luca.biasotto/Workspaces/ReactJS/Luca/apps## App git data, for auth see: https://isomorphic-git.org/docs/en/authentication.htmlAPPS={"ANACLETO_SAMPLE":{"id":"ANACLETO_SAMPLE","name":"SampleApp","repository":"https:\/\/github.com/cicciopasticcio/anacleto_sample.git","oauth2format":"github","username":"YOUR_GITHUB_TOKEN","password":"x-oauth-basic"},"ANACLETO_SAMPLE2":{"id":"ANACLETO_SAMPLE2","name":"SampleApp2","repository":"https:\/\/github.com/cicciopasticcio/anacleto_sample_2.git","oauth2format":"github","username":"YOUR_GITHUB_TOKEN","password":"x-oauth-basic"}}
## Tenants listTENANTS=[{"tenant":"TENANT1","description":"Tenant 1 SRL"},{"tenant":"TENANT2","description":"Tenant 2 SRL"}]## My sql ConnectionMYSQL_SETTINGS={"CONNECTION_NAME":{"connectionLimit":10,"host":"","user":"","password":"","database":""}}
ENV: project environment: development / test / production
PORT: listening port (Ex 3001)
LOG_DIR: log directory path
FIREBASE_SERIVCE_ACCOUNT: firebase service account json. To generate a private key file for your service account:
In the Firebase console, open Settings > Service Accounts.
Click Generate New Private Key, then confirm by clicking Generate Key.
Securely store the JSON file containing the key.
Copy service account JSON in this .env variable
LOGS_MAX_SIZE: max log file size (ex 20m)
LOGS_MAX_FILE: max log age (ex 1d)
SUPER_ADMIN: array of super admin id
GIT_SYNC_DIR: folder where the app sources are downloaded
APPS: a JSON with the apps data, you can specify a connection for each app:
Before you can add Firebase to your JavaScript app, you need to create a Firebase project and register your app with that project. When you register your app with Firebase, you'll get a Firebase configuration object that you'll use to connect your app with your Firebase project resources. Docs: follow step 1