onsite-builder v1.15.0
onsite-builder
Overview
Onsite Builder is a tool to create and modify Onsites. Users can add images, generate highlighted floor images (via Asset Builder), update room data, and specify a personalized theme and RFI form questions. Changes made during a user's session can be viewed in preview mode, and must be published before the changes will appear on the live Onsite.
The main page is a list of all properties that have Onsite enabled. The first time an Onsite is created, the data is built from the properties, floors, bookable_rooms, and bookable_rooms_metadata tables (see helpers/build-onsite-data.js) and a new Onsite is created in the onsite_configurations table. bookable_rooms_metadata is created in FPC's Bookable Room Form. Onsite Builder currently supports updating the following bookable room metadata: setup types, event types, images, description, and capacity. Note that updates to room name, dimensions, square feet, ceiling height, exiting required, total exiting, and address are NOT currently supported. Also note that any changes to the metadata made through the Bookable Room Form will NOT be reflected in an existing Onsite.
Application/Microservice dependencies
Make sure the following applications/microservices are running before starting up this app:
- asset-builder
- earth-portal
- api
- account-service
- authenticator
- lemmings
npm run eslint- Runs the ESLint check on the client/server source codenpm run test- Runs both the client and server side testsnpm run dev- Builds the client-side code and watches on the client-side code on changenpm run start- Starts the application servernpm run build- Builds the client-side source and exits on completion or error
Get Started
1) Switch to supported node version using nvm use.
2) Install dependencies with npm install.
3) To run locally, make sure you have two terminal windows open.
4) In one terminal window, run npm run dev to start the build task and watch changes
5) In the other terminal window, run npm run start to run the application server
6) Access the application at http://localhost:4000 via your web browser.
Env
The app relies on a number of env variables to run correctly. Most of these are required in all environments for the app to work as expected, but some are used for specific purposes and are not necessary (or even unwanted) in some environments.
We use dotenv to manage these dependencies locally. Before running the app for the first time, you must add a .env file to the working directory. Below is an example .env file which contains all env variables, with comments for special use.
DB_HOST="127.0.0.1"
DB_DATABASE="socialtables_local"
NODE_ENV=development
DB_USER="root"
DB_PASS=""
DB_CONNECTION_LIMIT="25"
API_HOST="http://localhost:6817"
LEMMINGS_HOST="http://localhost:2324"
ACCOUNT_SERVICE="http://localhost:8737"
PROPERTY_SERVICE="http://localhost:3030"
AUTHORIZATION_TOKEN=<< get token from someone >>
LEGACY_ST_PARTNER_TOKEN=<< get token from someone >>>
LEGACY_ST_USER_TOKEN=<< get token from someone >>
PORT=4000
ASSET_HOST="http://localhost:3003/gen"
WWW_URL="http://localhost:3210"
ONSITE_URL="http://localhost:3000"Deployment
main branch is deployed to the dv50 environment automatically via CircleCi every commit.
To deploy to production, you should:
- merge into main-
- increment the version and add a tag using
npm version <patch|minor|majorgit push && git push --tags
Deployment is managed via CircleCI
CDK Commands
You can run these commands from cdk directory to synthesize cloudformation template locally
yarn buildcompile typescript to jsyarn watchwatch for changes and compileyarn ecrlog into ECR repositoryyarn lslist stacksyarn deploydeploy this stack to your default AWS account/regionyarn diffcompare deployed stack with current stateyarn synthemits the synthesized CloudFormation template