Skip to content

This repository contains the source and demonstrations for the catalog of self-describing assets. This is an contribution from the Central Intelligence Platform Team

License

Notifications You must be signed in to change notification settings

Enterprise-Neurosystem/sd-catalog

Repository files navigation

sd-catalog

This project is a work in progress. Most planned features are not yet implemented, and we are coming up with a list of features and a plan/roadmap for their implementation.

This repository contains the source and demonstrations for the catalog of self-describing assets, a contribution from the Central Intelligence Platform Team.

This is a Next.js project bootstrapped with create-next-app.

Development recommended pre-requisites

Prettier is used for handling styling automatically. This tool runs on all code in a pre-commit step. It is recommended to also use prettier in your IDE so you see those prettier-related changes in your code prior to commit. The vscode-related config is already included in this project, but it requires the extension to be installed with the following command:

code --install-extension esbenp.prettier-vscode

You could also enable Format on save in vscode settings, which would ensure syntax changes this extension will make automatically appear on save.

Getting Started

Install dependencies

npm install

Development mode start

When in development mode, the app uses environment variables found in env.development. The app requires a back-end API available, and a mock version of this API server is included in the project. Below are steps to start the mock API server, update the back-end state, and then see changes in a web client.

  1. in terminal 1, start mock API server:
NODE_ENV=development npm run start-mock-api
  1. in terminal 2, start front-end server:
npm run dev
  1. Continue with steps in the this section below.

Production mode start

The following steps assume you are running the app in production on your local laptop. The steps would be slightly different regarding hostname and .env handling when deploying to a cloud provider or other remote server.

  1. localhost cannot be used when in production mode. Instead add a new hostname for your laptop to /etc/hosts:
echo '127.0.0.1 laptop.internal' | sudo tee -a /etc/hosts
  1. Copy the dev .env file for production:
cp .env.development .env.production.local
sed -i 's/localhost/laptop.internal/' .env.production.local

If on a mac, the sed command above will fail. Follow these steps:

brew install gnu-sed
gsed -i 's/localhost/laptop.internal/' .env.production.local
  1. in terminal 1, start mock API server in production mode:
NODE_ENV=production npm run start-mock-api
  1. in terminal 2, start front-end server in production mode:
npm run build
npm start
  1. Continue with steps in the this section below.

Validate

The environment is ready for validation after following either development or production steps above.

  1. in browser view initial static content: http://localhost:3000
  2. in terminal 3, update data in mock API server:
curl -X POST \
-H "Content-Type: text/plain" \
-d "{\"date\":\"2022-04-01T15:49:35.759Z\",\"title\":\"publish fix\",\"content\":\"some content\"}" \
http://localhost:3001/posts
  1. mock server calls front-end server webhook (automatic)
  2. front-end requests data from mock API server and regenerates static content (automatic)
  3. refresh page to see new static content

Learn More

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Team members

Below are links to the team. Contact Josh Purcell with any questions.

Meetings

Meetings are held bi-weekly on Wednesday at 5pm Eastern (UTC-5). Contact Josh (details above) for zoom details. Meeting minutes (if any) will be posted here.

About

This repository contains the source and demonstrations for the catalog of self-describing assets. This is an contribution from the Central Intelligence Platform Team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published