A simple implementation example (framework) of Deso Protocol's Smart Services.

Overview

Deso Smart Services

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Structure

The structure of this repo is as follows:

  • Config - Stores all project configuration for Docker, Nginx, Git, MongoDB, etc.
    • data - Any required project data, such as local Mongo data for development or certbot data for production
  • Scripts - Includes helpful utils for running the project in dev, stage, and prod. See Development & Deployment for more details.
  • SRC
    • Db - Stores database-related interactions
    • Events - Event listeners, including trigger()
    • Global - Global data such as constant values
    • Router - The router which handles incoming REST requests
    • Types - Custom types used throughout the project
    • Utils - Utility functions for repeat code & source modularity

Development & Deployment

Prerequisites

Getting Started

First, ensure that all the required prerequisites have been correctly installed. Without these, none of the following steps will work as expected. Once these are setup and good to go, you'll have a little bit of configuration to do. First, you'll want to set a MongoDB Connection String to $MONGO_CONNECTION_STRING. This can be accomplished using export, or by setting the variable in config/.env. If you're running the application in the Development environment, then using the included containerized DB instance is recommended. In that case, you add the following contents to config/.env:

MONGO_CONNECTION_STRING=mongodb://mongodb:27017

Once you've added the environment variable, you'll want to build the docker image. To accomplish this, you use the included App Script by running ./app.sh build in the config folder. Once this has completed, you're all set! To start the application in the Development environment you can again use the app script by running ./app.sh up dev. See the App Script section below for all available options.

App Script

To deploy the Smart Service, you can utilize the app.sh script. It takes a few possible arguments:

  • Action
    • up - Starts the application
      • dev
      • stage
      • prod
    • build - Builds a new App image (This is needed when files are added, and before you first run the project)
    • restart - Restarts the App service inside of Compose

Examples:

./app.sh up dev
./app.sh build
./app.sh restart

I personally like to run ./app.sh up dev in a split terminal with ./app.sh restart ready. This allows me to constantly view the logs for the app service in one window, while having the ability to restart the service whenever I make a change in the other.

SSL In Production

When building for production, you will also want to utilize the init-letsencrypt.sh script if you plan on using SSL. This will initalize Certbot and create a dummy SSL cert to then validate the creation of a free "Let's Encrypt" certificate. This script only has to be run once (The first time setting up the project), and requires an existing A record pointed at the server's IP.

Contributing

When making changes, please first format code using demo fmt, and lint using deno lint! Once everything is tested and looks good, open a PR.

You might also like...

This is a nodejs implementation of the python example

DOC This is a nodejs implementation of the python example provided in https://github.com/EnAccess/OpenPAYGO-Token. In case of anything please feel fre

Jan 25, 2022

Example implementation of having Google-Docs like comments

Example implementation of having Google-Docs like comments

lexical-comments Example implementation of having Google-Docs like comments in https://lexical.dev . Main ingredient that makes this possible is Comme

Dec 24, 2022

An example of implementation of the Veriifiable Presentation Generation Service specification.

Verifiable Presentation Generation Service A plugin-based service that allows issuers to render verifiable presentations from templates, and store it

Nov 16, 2022

An example implementation of the slack-gpt starter which ingests confluence pages to create a helpful slack bot

Slack-GPT (HR bot example implementation) Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting

Jul 31, 2023

A simple, no-hassle library for efficiently querying Your Enrollment Services.

@vanderbilt/yes-api A simple, no-hassle library for efficiently querying Your Enrollment Services. Created by Dylan Hanson (jovialis) NOTE: THIS MODUL

Jan 25, 2022

🥾 A simple way to do testing AWS Services and Jest or Serverless and Jest

jest-localstack-preset Install Install via yarn or npm $ yarn add https://github.com/thadeu/jest-localstack-preset.git or $ npm i https://github.com/t

Oct 1, 2022

SmartBuilder: A Block-based Visual Programming Framework for Smart Contract Development

SmartBuilder: A Block-based Visual Programming Framework for Smart Contract Development

SmartBuilder A Block-based Visual Programming Framework for Smart Contract Development Technology stack used SmartBuilder Framework - Google Blockly A

Mar 29, 2022

Simple Library implemented using HTML, CSS and JavaScript. This is a simple implementation of JavaScript Modules of ES6.

Awesome-books A single page project with the porpuse of storing books' titles and authors. Built With CSS, HTML & Javascript. How to run in your local

Feb 21, 2022

GatsbyContactFormBasedOnFormikAnalysis - This is example contact form for gatsby framework.

Gatsby minimal starter 🚀 Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Jan 2, 2022
Owner
Hunter Paulson
Co-Founder, @PrismWeb3, Inc.  President, @SeismicCore, LLC HPaulson.eth
Hunter Paulson
Smart Territory Framework Core using NEC Scorpio 2.0 and AWS serverless services

Smart Territory Framework Core - STF Core using NEC Scorpio Broker ⚠️ This stack is for demonstration purposes only. The nested stack deploying the NE

AWS Samples 9 Sep 30, 2022
A workshop about JavaScript iteration protocols: iterator, iterable, async iterator, async iterable

JavaScript Iteration protocol workshop A workshop about JavaScript iteration protocols: iterator, iterable, async iterator, async iterable by @loige.

Luciano Mammino 96 Dec 20, 2022
Groth16 proofs are very popular and are used by many protocols in production.

Geometry presents: the Groth16 Malleability Challenge Preamble Groth16 proofs are very popular and are used by many protocols in production. Libraries

Geometry 39 Dec 14, 2022
This Next.js app is designed to be used with the Figment Learn Pathways, to help developers learn about various blockchain protocols such as Solana, NEAR, Secret, Polygon and Polkadot!

???? What is learn-web3-dapp? We made this decentralized application (dApp) to help developers learn about Web 3 protocols. It's a Next.js app that us

t0nto 8 Oct 1, 2022
Calculates maximum composite SLA for a list of sequentially provided cloud services or your custom-defined services.

SlaMax Calculates maximum composite SLA for a list of sequentially provided cloud services or your custom-defined services. Here are a few use-cases y

Mikael Vesavuori 4 Sep 19, 2022
This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service

This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service. Integrating your service allows you to take actions based on end-user expressions and send dynamic responses back to the end-user.

ddayto 10 Jul 21, 2022
A lightweight Nano Node implementation made for wallets, exchanges and other services.

About This is a Light Nano Node implementation made for Wallets, Exchanges and other services. This Node has been built to be compatible with the offi

Nano - Light Net 7 Jun 25, 2022
A framework for building blockchain-enabled web services

NOTE: Not ready for public use. Please reach out via twitter dm or email with any questions. Ponder A framework for building blockchain-enabled web se

Olias 23 Dec 19, 2022
Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Testmo 1 Jan 1, 2022
Example auto-generated OpenAPI client library and an accompanying example Angular app.

To utilize this demo Head into petstore_frontend\petes_pets Run npm install Go to frontend_client_lib\out Run npm install Head back into petstore_fron

Alan Gross 1 Jan 21, 2022