BitCoin Schema
Community driven extensible schemas that enable developers to create interoperable data based applications. View schema in action.
- About
- Installation
- Deployment & Hosting
- Documentation
- Examples
- Code Standards
- Usage
- Maintainers
- Contributing
- Sponsors
- License
Standing on the shoulders of giants, our idea was inspired by the Schema.org project.
(more to come...) @Satchmo
This project uses gulp for workflow automation and docsify for the documentation generation and hosting.
Install all npm packages
$ make install
Serve the documentation via localhost:port
e.g. http://localhost:4000
$ make start
See more scripts in the package.json file or the makefile.
This repository has CI integration using AWS CodePipeline.
The build in AWS will deploy to firebase.
The actual build process can be found in the buildspec.yml file.
The application relies on AWS Secrets Manager and AWS SSM to store environment variables. Sensitive environment variables are encrypted using AWS KMS and then decrypted at runtime.
Deploy different environments by changing the <stage>
to production
or development
as example.
The default stage is production
if it's not specified.
Firebase Hosting Setup
- Start a new project and assign a CNAME
- Make sure the region is us-central
- Generate a CI
firebase_token
using the command:firebase login:ci
Create Environment Encryption Key(s) (AWS)
Create a KMS Key
per <stage>
for your application(s) to encrypt environment variables
make create-env-key stage="<stage>"
This will also store the kms_key_id
in SSM located at: /<application>/<stage>/kms_key_id
Manage Environment Variables (AWS)
app_id
is the Firebase application id for the projectproject
is the Firebase project_idsender_id
is the Firebase sender_id for the project
Add or update your project information (all parameters are required)
make firebase-save-project \
app_id="YOUR_APP_ID" \
project="YOUR_PROJECT_ID" \
sender_id="YOUR_SENDER_ID" \
stage="<stage>";
Manage Environment Secrets (AWS)
firebase_api_key
is found in the Firebase console for that specific projectfirebase_token
is theci:login
token that is generated fromfirebase login:ci
github_token
is a personal token with access to make a webhookkms_key_id
is from the previous step (Create Environment Encryption Keys)
Add or update your secrets (all parameters are required)
make save-secrets \
firebase_api_key="YOUR_FIREBASE_API_KEY" \
firebase_token="YOUR_FIREBASE_CI_TOKEN" \
github_token="YOUR_GITHUB_TOKEN" \
kms_key_id="YOUR_KMS_KEY_ID" \
stage="<stage>";
Create CI Environment (AWS)
Prerequisites
- An AWS account
- Deploying requires permission to: KMS, SSM, Secrets Manager and Cloud Formation
- AWS CLI (
brew install awscli
) - SAM CLI (
brew tap aws/tap && brew install aws-sam-cli
)
This will create a new AWS CloudFormation stack with:
- (1) CodePipeline with multiple stages to deploy the application from Github
- (1) CodePipeline Webhook to receive Github notifications from a specific
branch:name
- (1) CodeBuild Project to build and deploy the app
- (2) Service Roles for working with CodeBuild and CodePipeline
NOTE: Requires an existing S3 bucket for artifacts and sam-cli deployments (located in the Makefile)
One command will build, test, package and deploy the application to AWS. After initial deployment, updating is as simple as committing to Github.
make deploy
(Example) Customized deployment for another stage
make deploy stage="development" branch="development"
(Example) Customized deployment for a feature branch
make deploy stage="development" branch="some-feature" feature="some-feature"
(Example) Customized S3 bucket location
make deploy bucket="some-S3-bucket-location"
(Example) Customized tags for the deployment
make deploy tags="MyTag=some-value AnotherTag=some-value"
Tear Down CI Environment (AWS)
Remove the stack (using default stage: production
)
make teardown
(Example) Teardown another stack via stage
make teardown stage="development"
(Example) Teardown a feature/branch stack
make teardown stage="development" feature="some-feature"
Visit our live documentation site.
Release Deployment
goreleaser for easy binary or library deployment to Github and can be installed via: brew install goreleaser
.
The .goreleaser.yml file is used to configure goreleaser.
Use make release-snap
to create a snapshot version of the release, and finally make release
to ship to production.
Makefile Commands
View all makefile
commands
make help
List of all current commands:
audit Checks for vulnerabilities in dependencies
aws-param-certificate Returns the ssm location for the domain ssl certificate id
aws-param-zone Returns the ssm location for the host zone id
build Builds the package for web distribution
clean Remove previous builds and any test cache data
create-env-key Creates a new key in KMS for a new stage
create-secret Creates an secret into AWS SecretsManager
decrypt Decrypts data using a KMY Key ID (awscli v2)
decrypt-deprecated Decrypts data using a KMY Key ID (awscli v1)
deploy Build, prepare and deploy
encrypt Encrypts data using a KMY Key ID (awscli v2)
env-key-location Returns the environment encryption key location
firebase-deploy-simple Deploys to firebase with limited flags
firebase-get-env Gets the current environment variables in the associated project
firebase-param-app-id Returns the location of the app_id parameter in SSM
firebase-param-location Creates a parameter location (for Firebase details in SSM)
firebase-param-project Returns the location of the project-id parameter in SSM
firebase-param-sender-id Returns the location of the sender_id parameter in SSM
firebase-save-project Saves the firebase project information for use by CloudFormation
firebase-set-env Set an environment variable in a firebase project
firebase-update Update the firebase tools
help Show this help message
install Installs the dependencies for the package
invalidate-cache Invalidates a cloudfront cache based on path
lint Runs the standard-js lint tool
outdated Checks for outdated packages via npm
package Process the CF template and prepare for deployment
release Full production release (creates release in Github)
release-snap Test the full release (build binaries)
release-test Full production test release (everything except deploy)
replace-version Replaces the version in HTML/JS (pre-deploy)
save-domain-info Saves the zone id and the ssl id for use by CloudFormation
save-param Saves a plain-text string parameter in SSM
save-param-encrypted Saves an encrypted string value as a parameter in SSM
save-secrets Helper for saving sensitive credentials to Secrets Manager
start Start the documentation site
tag Generate a new tag and push (tag version=0.0.0)
tag-remove Remove a tag if found (tag-remove version=0.0.0)
tag-update Update an existing tag to current commit (tag-update version=0.0.0)
teardown Deletes the entire stack
test Runs all tests
update-secret Updates an existing secret in AWS SecretsManager
upload-files Upload/puts files into S3 bucket
Websites or applications using Schema:
Please read our standards document
Here's the getting started with schema
MrZ | Satchmo |
Feel free to dive in! Suggest a new schema or submit PRs.
Open source tools that we used in this project:
- docsify - A magical documentation site generator
- mythbusters js - Professional deployment of docsify
Contribute today and join the team!
MrZ | Satchmo |
Are you interested in becoming a sponsor of Schema? Let us know!
TonicPow | MetaLens | All Aboard |