Go to file
pfych fc91faa0f9
Some checks failed
Build & Lint / build-lint (push) Failing after 1m8s
Deploy / setup (push) Failing after 1m3s
Updated scripts & changed list view
2024-10-20 10:33:28 +11:00
.github/workflows Init 2024-10-12 14:08:09 +11:00
.vscode Init 2024-10-12 14:08:09 +11:00
commands/add-object Init 2024-10-12 14:08:09 +11:00
packages Updated scripts & changed list view 2024-10-20 10:33:28 +11:00
scripts Init 2024-10-12 14:08:09 +11:00
shared Init 2024-10-12 14:08:09 +11:00
.eslintrc.js Init 2024-10-12 14:08:09 +11:00
.gitignore Init 2024-10-12 14:08:09 +11:00
.prettierrc.js Init 2024-10-12 14:08:09 +11:00
baseline-core-architecture.png Init 2024-10-12 14:08:09 +11:00
LICENSE Init 2024-10-12 14:08:09 +11:00
package.json Init 2024-10-12 14:08:09 +11:00
pnpm-lock.yaml Init 2024-10-12 14:08:09 +11:00
pnpm-workspace.yaml Init 2024-10-12 14:08:09 +11:00
README.md Updated README 2024-10-12 14:23:11 +11:00
tsconfig.json Init 2024-10-12 14:08:09 +11:00

BMS Repository

An extremely simple serverless application that manages BMS Zip files. Clients can request download URLs by providing either md5 or sha256 of the requested chart.

This service also offers a basic admin dashboard for managing charts in the system.

The system is not designed to provide any UI/UX to end users for listing and downloading charts.

This README will be updated as the application is developed.


Request:

curl --request POST \
  --url https://<API_URL>/chart/public \
  --header 'Content-Type: application/json' \
  --data '{ "md5": [], "sha256": [] }'

Response Type:

interface Chart {
  chartId: string; // Internal to system
  name: string;
  md5: string;
  sha256: string;
  resourceUri?: string; // URI of the chart zip file
  parentChart?: string; // Internal Id of parent chart (chartId)
  comment?: string; // Note from maintainers
}

interface Response {
  md5: Record<string, Chart>; // keyed by md5
  sha256: Record<string, Chart>; // keyed by sha256
  parents: Chart[]; // If any parent charts are required
}

Local Requirements

These must be installed before following the setup instructions.

  • Macos/Linux OS/Windows Subsystem for Linux
    • Node.js v20 (v20 or higher) & npm@10.5.0 or higher (we suggest installing and using nvm) follow instructions in the link to install, you will generally need to create a new terminal session after installing. If you already have nvm update it before proceeding.
      • If nvm is installed you can switch versions with nvm install 20 && nvm use 20 && nvm alias default 20 && nvm install-latest-npm
      • If not using nvm you can manually install node and npm, download from https://nodejs.org/en/download/ alternatively use the operating system package manager or any other appropriate tool to install node
      • Current versions can be checked with node -v, npm -v
    • pnpm version 9, version can be checked with pnpm -v, install with npm install -g pnpm@9 or other methods
    • AWS CLI v2
    • Homebrew, for Mac users only, follow install instructions here
    • jq for extracting Cloudformation outputs
      • Install on mac brew install jq
      • Install on Linux sudo yum install jq or sudo apt-get install jq, or other appropriate methods
    • Java Runtime Environment (JRE) version 8.x or newer, it is only required for DynamoDB local
      • Install on mac brew install java
      • Install on linux sudo yum install java or sudo apt-get install openjdk-8-jdk, or other appropriate methods
      • DynamoDB local will automatically install in the project when the api is started, java needs to installed before this occurs
    • curl which is used in some of the bash scripts, curl install instructions
    • An IDE such as Visual Studio Code
  • Internet connectivity
  • AWS Account https://aws.amazon.com/getting-started/
  • IAM credentials https://docs.aws.amazon.com/cli/latest/userguide/getting-started-prereqs.html#getting-started-prereqs-iam be sure to follow Security best practices in IAM

Run Locally

If the project is already setup and you are trying run the project locally make sure you run pnpm run aws:profile first so that you have the correct credentials for AWS configured locally.

Commands

Start the api, admin and web in their own terminal windows/tabs with the following commands.

  1. pnpm run generate:env:local to generate the env files for the frontend clients
  2. pnpm run start:api
  3. pnpm run start:admin

Running locally Limitations

  • API, Web & Admin: No S3, you will need to rely on AWS staging S3
  • API: No local Cognito Authorizer, the deployed staging cognito can be used (see packages/api/serverless.yml) or the payload set by AUTHORIZER in packages/api/scripts/run-api-local.sh.
  • Admin: Cognito UI relies on an active AWS Cognito user pool, use deployed staging

Deploy a Change

Swap staging to prod to deploy to production. All environment variables will be automatically set in the process.

  1. pnpm run deploy:staging to deploy api/web/admin

Remove Stack

To destroy the deployed cloudformation stacks so it is no longer on AWS run pnpm run remove:staging. This will likely destroy all data associated with the application.

Built using BaselineJS

1688515420018

BaselineJS is an open-source, fullstack TypeScript, serverless first framework designed to make building cloud native applications easier. Our framework utilizes a combination of modern technologies, architectures and operational processes to help teams to efficiently build and deploy robust applications

If you like BaselineJS give us a

Website | Documentation | Discord | LinkedIn | YouTube

Startups, want $10k USD of AWS Credits to Get Started? Apply Here