Menu

Tree [4a635d] develop v0.15.1-rc.9 /
 History

HTTPS access


File Date Author Commit
 .githooks 2021-12-06 Angus Salkeld Angus Salkeld [01f998] chore: replace golint and goimports with golang...
 .github 2022-03-23 Angus Salkeld Angus Salkeld [6f4525] chore: sync the issue templates from the cli
 contracts 2022-02-23 Ryan Cartwright Ryan Cartwright [743e5f] feat: Add resource type key for secrets
 docs 2022-03-07 Tim Holm Tim Holm [003e98] docs: Update README header.
 mocks 2022-03-15 Tim Holm Tim Holm [e21712] chore: generate mocks and update azure resource...
 pkg 2022-03-24 Tim Holm Tim Holm [e504c8] fix(gcp/storage): Add missing auth scope for ur...
 tests 2022-03-04 Tim Holm Tim Holm [49c18f] chore: Allow test provider mock to be called an...
 tools 2021-12-06 Angus Salkeld Angus Salkeld [01f998] chore: replace golint and goimports with golang...
 .dockerignore 2020-12-21 Tim Tim [6f63c7] chore: Additional fixes and cleaning up. Tested...
 .gitignore 2022-01-13 Tim Holm Tim Holm [56403f] ci: Add checks for checking in generated sources.
 .golangci.yml 2021-12-06 Angus Salkeld Angus Salkeld [b6a4d3] chore: enable ineffassign linter
 LICENSE 2021-04-29 Tim Holm Tim Holm [eacd07] chore: Don't modify original license.
 README.md 2022-03-03 Rak Rak [8ae6a1] chore: refresh readme to stay consistent with w...
 alpine.dockerfile 2021-04-28 Tim Holm Tim Holm [ce797f] chore: Add copyright headers to source and dock...
 debian.dockerfile 2021-04-28 Tim Holm Tim Holm [ce797f] chore: Add copyright headers to source and dock...
 go.mod 2022-03-21 Angus Salkeld Angus Salkeld [38e26c] fix: converting slice or maps of specific types...
 go.sum 2022-03-21 Angus Salkeld Angus Salkeld [38e26c] fix: converting slice or maps of specific types...
 launch.json 2021-04-27 Tim Holm Tim Holm [b3dec8] feat: WIP fasthttp refactor.
 lichen.yaml 2021-08-27 davemooreuws davemooreuws [7df464] chore: allow bsb-2 clause
 makefile 2022-03-15 Tim Holm Tim Holm [e21712] chore: generate mocks and update azure resource...
 pluggable_membrane.go 2022-02-21 Angus Salkeld Angus Salkeld [c25214] chore: Use log.Default().Print* functions inste...

Read Me

Nitric Logo

A fast & fun way to build portable cloud-native applications

GitHub release (latest SemVer) GitHub GitHub Workflow Status codecov Twitter Follow

About Nitric

Nitric is a framework for rapid development of cloud-native and serverless applications. Define your apps in terms of the resources they need, then write the code for serverless function based APIs, event subscribers and scheduled jobs.

Apps built with Nitric can be deployed to AWS, Azure or Google Cloud all from the same code base so you can focus on your products, not your cloud provider.

Nitric makes it easy to:

  • Create smart serverless functions and APIs
  • Build reliable distributed apps that use events and/or queues
  • Securely store, retrieve and rotate secrets
  • Read and write files from buckets

Documentation

The full documentation is available at nitric.io/docs.

We're completely opensource and encourage code contributions.

Status

Nitric is currently in Public Preview. Anyone can use or deploy applications, but work remains and changes are likely. We’d love your feedback as we build additional functionality!

Get in touch

Nitric Membrane

The Membrane is at the heart of the solution. Nitric applications communicate with the Membrane via gRPC to access the following services in a provider agnostic way:

  • Events
  • Queues
  • Storage & Buckets
  • Document Store
  • Secret Store

We provide an expressive infrastructure-as-code style SDK for Node.js. However, Nitric is built on gRPC, so support for many languages is possible.

If you have additional languages you'd like supported, let us know in the issues, we also welcome community contributions for new language support.

Development

Requirements

  • Git
  • Golang (1.16)
  • Make
  • Docker
  • Google Protocol Buffers Compiler

Getting Started

Install dependencies

make install-tools
Install Protocol Buffers

Download the Google Protobuf Compiler (standalone binary called protoc) from https://github.com/protocolbuffers/protobuf and add it to your $PATH.

On MacOS with Homebrew, you can run brew install protobuf
On Fedora, run sudo dnf install -y protobuf protobuf-compiler protobuf-devel

Run unit tests

make test

Run integration tests

make test-integration

Build Static Membranes

AWS

Standard Binary

Linux support only - used in container images and for production.

make aws-static
Cross-platform Binary

Useful for local testing

make aws-static-xp
Container Images
make aws-docker

Google Cloud Platform

Standard Binary

Linux support only - used in container images and for production.

make gcp-static
Cross-platform Binary

Useful for local testing

make gcp-static-xp
Container Images
make gcp-docker

Dev Membrane

Note: the Dev Membrane should only be used for local development and testing.

Standard Binary

The dev binary is always cross-platform, since it doesn't need to be optimized for production deployments.

make dev-static
Container Images
make dev-docker

Run Locally

To run the membrane server locally, perform a local build of the membrane binary for the platform you're targeting, then run the resulting binary.

Example building and running the static Google Cloud Membrane locally
# Make the GCP Static Cross-platform binary
make gcp-static-xp

# Run the membrane binary
./bin/membrane

Note: for the AWS membrane, the Lambda Gateway (default) will fail to start. Instead, set the GATEWAY_ENVIRONMENT environment variable so that the HTTP gateway is launched instead.

# Make the AWS Static Cross-platform binary
make aws-static-xp

# Set environment variable in subshell, then run the membrane binary
(export GATEWAY_ENVIRONMENT=http; ./bin/membrane)
Running without a child process

It can be useful to run the Membrane in a 'service only' mode, where the cloud APIs are available but you don't need/want to start a child process to handle incoming request. This can be achieved by setting the MIN_WORKERS variable to 0:

(export MIN_WORKERS=0; ./bin/membrane)

Project Structure

The Membrane project source code structure is outlined below:

Directory Package Description
/interfaces/nitric/v1 v1 protoc generated GRPC services code
/pkg/adapters/grpc grpc GRPC service to SDK adaptors
/pkg/membrane membrane membrane application
/pkg/plugins/... ... Cloud service SDK plugins
/pkg/providers/... main Cloud provider main application and plugin injection
/pkg/sdk sdk SDK service interfaces
/pkg/triggers triggers provides Nitric event triggers
/pkg/utils utils provides utility functions
/pkg/worker worker Membrane workers representing function/service connections
/tests/mocks/... ... Cloud service SDK mocks
/tests/plugins/... ... Plugin services integration test suites
/tools tools include for 3rd party build tools

Ideas for using Nitric

Examples of projects built with Nitric:

  • Identity verification APIs
  • FinTech APIs with complex business rules
  • Move from Express.js or koa to serverless and distributed architectures
  • Migrate from on-prem to the cloud (AWS, Azure or GCP)

Even though your apps are portable across clouds, they'll still make the best use of the fully-managed and serverless offerings of each cloud provider. Nitric deploys using services like Lambda, CloudRun, DynamoDB, FireStore, CosmosDB, SNS, Event Grid, PubSub... the list is super long. Nitric also makes sure IAM and other access is correctly configured in your deployed applications, so everything stays secure and just works.