Coder Social home page Coder Social logo

gwenshap / examples-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markroddy/nile-examples

0.0 0.0 0.0 16.49 MB

Examples that demonstrate how to use Nile for infrastructure SaaS products

License: Apache License 2.0

Shell 0.03% JavaScript 9.20% Python 7.60% TypeScript 75.40% CSS 0.96% HTML 1.89% Batchfile 0.03% Dockerfile 0.81% EJS 4.08%

examples-1's Introduction

Nile Examples

image

Overview

This collection of examples demonstrates how to use Nile as a control plane for an Infrastructure SaaS product. Nile provides an entity system, event system, and tenant-aware metrics.

The mock scenario in these examples is a company that provides SaaS.

image

These examples let you choose what kind of SaaS offering is provided, one of:

Where to start

First decide which offering you want to use, then run the Quickstart to setup your control plane in Nile. Follow on with any of the other modules for different use cases. The modules can also be run sequentially to build on top of one another, in which case, we recommend running them in the order presented here to build up your SaaS as you go. Finally, after you run the webapp example which includes a front-end for self-service provisioning, a user can log in to read and create new entity instances, for example:

image

And view metrics for each of their instances:

image

Contents

Setup

To run these examples:

  1. You must have access to Nile, please reach out for more information.

  2. Validate your environment has the minimum required Node version v18.0.0 or higher. If you are running earlier versions, you may encounter errors such as ReferenceError: fetch is not defined. (If you use nvm, run nvm use).

  3. Obtain the following parameter values that represent your control plane configuration in Nile. These can be an existing control plane or a new one will be created for you from these values. NILE_ENTITY_NAME refers to one of the usecases.

    • NILE_URL
    • NILE_WORKSPACE
    • NILE_DEVELOPER_EMAIL
    • NILE_DEVELOPER_PASSWORD
    • NILE_ORGANIZATION_NAME
    • NILE_ENTITY_NAME: choose one of the usecases

    At the top-level of the examples repo, copy the .env.defaults file to .env and set the values in this .env file to match the values you want in your control plane. It will be used for all the examples.

    cp .env.defaults .env

Note: the languages presented below are an indication just of which examples have been developed, not of what's available. Please see the Nile API and SDK documentation for details.

Quickstart

Start with the quickstart to configure a base Nile control plane. This provides a simple setup to learn the concepts but also serves as the foundation for the other examples below.

  • Quickstart | JS SDK | Setup a minimal Nile control plane with a single tenant

Multi-tenancy

Tenants have access to specific organizations that have isolated sets of resources. Users are allowed to access only the entity instances in the organizations to which they have been added.

  • Multi-tenancy | JS SDK | Setup the Nile control plane with multiple tenants and users

Data Plane

These examples show how to synchronize, e.g. reconcile, your data plane and control plane in real time with Nile events. As instances are created or destroyed from the control plane, the example reconciler creates or destroys data plane deployments. Even if you're using another deployment tool like Kubernetes or Terraform, similar principles apply as they do for Pulumi.

Authorization

Attribute-based access control (ABAC) is an authorization model that gives you fine-grained authorization capabilities. You can configure these in the control plane so that they are aligned to your business's security policies.

Webapp

Configure a front-end web application that is customizable on a per-tenant basis. The webapp includes Nile React components for metrics, because it is critical for any SaaS to be able to measure and monitor consumption and do accurate tenant billing. These metrics can be exposed externally to the end user as well as internally for business operations.

  • Webapp | JS SDK | Builds a self-service frontend that integrates with Nile on the backend

Other

Here are additional examples that you can refer to.

  • Python + Flask Todo List Webapp | Python REST | Take a basic Todo List webapp written in Python and Flask and turn it to a PLG SaaS product with Nile APIs

examples-1's People

Contributors

dependabot[bot] avatar gwenshap avatar jrea avatar julian avatar markroddy avatar norwood avatar scottydawg avatar ybyzek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.