CIOBrain is the visualization of the mind of a CIO.
Node.JS is required for setting up.
- Run the
npm install
command on this project. This can be done by navigating a terminal window to have its current directory be the root folder of this project, then running the command. - Run the
npm start
command on this project.
- Navigate to Postman
- Sign up for an account if you don’t already have one
- Download Postman
- Open Postman and Login
- Navigate to “My Workspace” or Create a new workspace
- Next to “My Workspace”, select “Import” > “File” > “Upload Files”
- Navigate to the CIOBrainAPI project folder > “sample requests” > “CIOBrain API.postman_collection” inside File Explorer
- “CIOBrain API.postman_collection” is for local testing when the API is hosted on localhost
- Import “CIOBrain API - Production.postman_collection” to also test the API when it’s running in Azure.
- “Import”.
- Select a request from within a folder and “Send”
- For POST requests, make sure the request body is filled out accordingly.
- For GET requests, no request body is needed.
- More information for how api endpoints can be called can be found in index.js.
- Acquire the datasets for application, data and infrastructure.
- Rename the excel files according to the corresponding file name:
- Application.xlsx
- Data.xlsx
- Infrastructure.xlsx
- Replace the respective files under the
./src/data/
folder
The log.txt
file can be found in the ./src/data/
folder. If this file is missing, no errors were found or recorded.
While there are many ways to approach deployment, this guide will use VSCode and Microsoft Azure.
- Open VsCode
- Select the Extensions from the left menu bar (fifth icon)
- Or [Ctrl]-[Shift]-[X]
- Search “Azure App Service” and “Install”
- Open the CIOBrain API project in VsCode
- Select Azure from the left menu bar
- Or [Shift]-[alt]-[A]
- Expand the “App Service” Tab
- Select the second icon to “Deploy to Web App”
- Select “Create new Web App (Advanced)”
- For the name of the web app, enter “CIOBrainAPI”
- The name must be exactly written as above so that url of the api is generated as https://ciobrainapi.azurewebsites.net/ and the front-end is configured to send requests to this url.
- Select “Create new resource group”
- Enter a name for the new resource group (ie. “CIOBrainAPI-resource”)
- For the runtime stack, select “Node 14 LTS”
- For the OS, select “Windows”
- For the location for new resources, select “Central US”.
- “Central US” resources are the closest to Texas and therefore, will give us the fastest response times. This can change if the location of the website user/tester is closer to the west or east coast.
- For the Windows App Service Plan, select “Create new App Service plan”
- Enter a name for the new service plan (ie. “CIOBrainAPI-plan”)
- For the pricing tier, select “Free (F1)”.
- This can change if the website scales or if other Azure features are needed.
- For the Application Insights resource, select “Skip for now”.
- After the API has deployed, “CIOBrainAPI” should be listed under “App Service”. When the API has finished deploying, left click “Application Settings” under “CIOBrainAPI” > “Add new setting”.
- For “new app setting name”, enter “SCM_DO_BUILD_DURING_DEPLOYMENT”
- For “value”, enter “true”. This enables build automation identifying the start script and generating a web.config file.
- Right click “CIOBrain API” and select “Deploy to Web App” to redeploy.
- When the warning message pops up, select “Deploy” to confirm.
- Navigate to https://ciobrainapi.azurewebsites.net/ and you should see
- Navigate to https://ciobrainapi.azurewebsites.net/asset/application/1 to see data responses from specific api endpoints
- If after deployment, the app deploys successfully, but the Azure help page shows up instead of the CIOBrain application, ensure the API is being run on process.env.PORT in index.js.
- If after deployment, the app shows “You do not have permission to view the directory or page”. The web.config file was probably not generated correctly. Redeploy the web app or recreate the web app from scratch.