Bakus-Naur Form for NoteWeb PaaS DSL - Summer 2024 Update

Note Web DSL Summer 2024 syntax changes are non-breaking and add support for the following cases:

  • Unit/integration tests in generated service code
  • Messaging Kafka/Servlerless
  • Defining UI and client types
  • Integrating video chat, RAG, avatar features into generated solutions

                <block> ::= (<contextStatement> | <statement>)+

                <contextStatement> ::= "context" <string literal> ("runat" <string literal>|"repo" <string literal>)* INDENT (<cloudAccountStatement>|<dashboardStatement>)+ DEDENT

                <cloudAccountStatement> ::= "cloud" <string literal> (type "AWS"|type "Azure"|deploy "Ansible"|deploy "Terraform")* INDENT (<cloudStatement>)* DEDENT

                <cloudStatement> ::= "user" <string literal>
                              | "bucket" <string literal>
                              | "vpc" <stringLiteral> INDENT (<vpcContent>)+ DEDENT
                              | <containerServiceStatement>
                              | <kubernetesServiceStatement>
                              | "app service" <string literal> "image" <string literal> <resourceEntities>
                              | <lambdaStatement>
                              | "queue" <string literal>
                              | "load balancer" <string literal>
                              | "search engine" <string literal>
                              | "auth" <string literal>
                              | <apiGatewayStatement>
                              | <cdnStatement>
                              | <containerClusterStatement>
                              | <kubernetesClusterStatement>
                              | <databaseClusterStatement>
                              | <databaseInstanceStatement>
                              | "volume" <string literal> "type" <string literal> "config" <string literal>
                              | "secret" <string literal> <string literal>
                              | "resource" <string literal> "type" <string literal> "url" <string literal> INDENT (<resourceEntities>)+ DEDENT


                <lambdaStatement> ::= "lambda" <string literal> "template" <string literal> "ref" <string literal> "index" <string literal> "logs" <string literal> "metrics" <string literal> <serviceEntititesVolumesEnvs>
 

                <apiGatewayStatement> ::= "api gateway" <string literal> ["auth" <string literal>] INDENT
                  ("ref" <string literal> "url" <string literal>)+ DEDENT
 

                <cdnStatement> ::= "cdn" <string literal> INDENT
                  ("ref" <string literal> "path" <string literal> "url" <string literal>)+ DEDENT
 

                <dashboardStatement> ::= "dashboard" <string literal> INDENT ("web note" <string literal> "aspect" <string literal> "ref" <string literal>)+ DEDENT

                <containerClusterStatement> ::= "container cluster" <string literal>

                <kubernetesClusterStatement> ::= "kubernetes cluster" <string literal> "cidr" <string literal> "subnets" <string literal>

                <databaseClusterStatement> ::= "database cluster" <string literal> "type" <string literal> INDENT <databaseInstanceStatement>+ DEDENT

                <databaseInstanceStatement> ::= "database instance" <string literal> "type" <string literal> <resourceEntities>
 

                <containerServiceStatement> ::= "container service" <string literal> "image" <string literal> ("runat" <string literal> | "registerdns" <string literal> | "registerlb" <string literal> | "repo" <string literal> | "template" <string literal> | "package" <string literal> | "database type" <string literal> | "database url" <string literal> | "url" <string literal> | "ref" <string literal> | "subnets" <string literal> | "security groups" <string literal> | "config" <string literal> | "index" <string literal> | "logs" <string literal> | "metrics" <string literal>)+ <serviceEntititesVolumesEnvs>

                <kubernetesServiceStatement> ::= "kubernetes service" <string literal> "image" <string literal> ("runat" <string literal> | "registerdns" <string literal> | "registerlb" <string literal> | "repo" <string literal> | "template" <string literal> | "package" <string literal> | "database type" <string literal> | "database url" <string literal> | "url" <string literal> | "ref" <string literal> | "subnets" <string literal> | "security groups" <string literal> | "config" <string literal>  | "index" <string literal> | "logs" <string literal> | "metrics" <string literal>)+ <serviceEntititesVolumesEnvs> 
 

                <resourceEntities> ::= (INDENT ("entity" <string literal> INDENT ("field" <string literal> "type" <string literal>)+ DEDENT)+ DEDENT)?

                <serviceEntititesVolumesEnvs> ::= (INDENT ("entity" <string literal> INDENT ("field" <string literal> "type" <string literal>)+ DEDENT | "volume" <string literal> "runat" <string literal> | "env" <string literal> ( "value" |"secret" ) <string literal>)+ DEDENT)?
 

                <vpcContent> ::= "vm" <string literal> "type" <string literal> "image" <string literal>
 

                <statement> ::= "exit"
                              | "read input" (<identifier> ",")* <identifier>
                              | "call service" <identifier> "with" <stringLiteral> ("into" <identifier>|<string literal>)
                              | "switch" ":" INDENT (<ifThen>)+ [otherwiseThen] DEDENT

                <ifThen> ::= <condition> "->" INDENT <block> DEDENT
 

                <otherwiseThen> ::= "otherwise" "->" INDENT <block> DEDENT
 

                <condition> ::= <identifier> "==" <stringLiteral>

 

 

Note Web DSL code example per updated BnF:


/* Solution Architect: simple CRUD for drivers/fleet */

context "driver-vehicle-trip-management" runat "driver-vehicle-trip-management-ui-bucket" repo "driver-vehicle-trip-management-repo"
 dashboard "driver-vehicle-trip-management-dashboard"
   web note "DriverProfileForm" aspect "Form" ref "driverLambda"
   web note "VehicleProfileForm" aspect "Form" ref "vehicleLambda"
   web note "TripForm" aspect "Form" ref "tripLambda"
 cloud "aws-account"
   search engine "fleet-search"
   user "fleet-manager"
   auth "driver-vehicle-trip-management-user-pool"
   bucket "driver-vehicle-trip-management-ui-bucket"
   database cluster "main-db-cluster" type "mysql"
     database instance "main-db" type "mysql"
       entity "Driver"
         field "driver_id" type "int;id;auto"
         field "first_name" type "varchar(250)"
         field "last_name" type "varchar(250)"
         field "date_of_birth" type "varchar(250)"
         field "years_driver_experience" type "int"
       entity "Vehicle"
         field "vehicle_id" type "int;id;auto"
         field "vin" type "varchar(250)"
         field "licence_plate_number" type "varchar(250)"
         field "color" type "varchar(250)"
         field "model" type "varchar(250)"
         field "brand" type "varchar(250)"
   resource "driver-vehicle-trip-dynamodb-tables" type "dynamodb"
     entity "Trip"
       field "driver_id" type "int"
       field "vehicle_id" type "int"
       field "pick_up_point" type "varchar(250)"
       field "drop_off_point" type "varchar(250)"
       field "planned_start" type "varchar(250)"
       field "actual_start" type "varchar(250)"
       field "actual_end" type "varchar(250)"
       field "length" type "int"
       field "duration" type "int"
   lambda "driverLambda" template "CRUD" ref "Driver" index "fleet-search.drivers" logs "fleet-search.app_logs"
   kubernetes service "vehicleLambda" template "container/nodejs/TypescriptNodejsContainer.sh" ref "Vehicle"
   lambda "tripLambda" template "CRUD-index-python" ref "Trip" logs "fleet-search.app_logs" metrics "count; total length; total duration"
   api gateway "api-gateway" auth "driver-vehicle-trip-management-user-pool"
     ref "driverLambda" url "driver"
     ref "vehicleLambda" url "vehicle"
     ref "tripLambda" url "trip"
   cdn "cdn-route"
     ref "api-gateway" path "production" url "production/*"
     ref "driver-vehicle-trip-management-ui-bucket" path "/" url ""

 




Note In Web, Inc. © September 2022-2024; Denys Havrylov © 2018-August 2022