Setup Anacleto
Anacleto's development environment consists of two NodeJS services that you can configure on any PC or Mac.
Install NodeJs and npm Docs
Anacleto Backend
Create backend project folder
mkdir sample-app-backendInit node project
npm initCreate index.js file
require("dotenv").config({ path: __dirname + "/.env" });
const Anacleto = require("anacleto-backend");
Anacleto();Instal anacleto-backend
npm install anacleto-backendAdd star script to package.json
{
"name": "sample-app-backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"anacleto-backend": "^1.0.0",
"dotenv": "^16.0.3"
}
}Create .env file and save on anacleto-backend root.
ENV: project environment: development / test / productionPORT: listening port (Ex 3001)LOG_DIR: log directory pathFIREBASE_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 idGIT_SYNC_DIR: folder where the app sources are downloadedAPPS: a JSON with the apps data, you can specify a connection for each app:APPidnamerepositoryusernamepassword
ex:
TENANTS: array of available tenantsMYSQL_SETTINGS: MySql connectionsDATASTORE_SETTINGS: Google Datastore connection dataBIGQUERY_SETTINGS: Google BigQuery connection data
Start anacleto-backend module
Anacleto Frontend
Anacleto frontend is a react app, first you need to create a new React app
Install anacleto-frontend
Load Anacleto from index.js file
Create .env file and save on project root folder
REACT_APP_ENV: project enviroment: development / test / productionREACT_APP_BACKEND_HOST: anacleto-backend urlREACT_APP_LOGIN_MESSAGE: anacleto-frontend login messageREACT_APP_FIREBASE_CONFIG: your Firebase project configuration JSON
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
Start Anacleto frontend
Last updated