Trawler - Trawler is a BaaS system. Backend as a service

Overview

Trawler is a BaaS system. Backend as a service.

BaaS

Generate REST and GraphQL frontend based on model defined in YAML that can be persisted in many different backend: streams, document stores, RDMBS, and search engines. Add RBAC and ACL support via IAM system integration.

Model

Model.yaml Example simple model

module-namespace: Company


validation-rules:
  phone:
    min: 5
    max: 15
    regex: '\(?\<[0-9]{3}[-) ]?[0-9]{3}[ -]?[0-9]{4}\>'

field-definitions:
  UUID:
    type: uuid 
  Name:
    type: string 
    # validation-rules: add validation rules here
    # length 
  PhoneNumber:
    type: string
    validation-rules: [phone]
    
  
defininitions:
  Employee:
    description: An employee of a company 
    fields:
      id:
        fieldDefinition: UUID 
        views: [admin] 
      firstName:
        fieldDefinition: Name 
        views: [*] # defaults to all views 
      lastName:
        fieldDefinition: Name
      homeNumber:
        fieldDefinition: PhoneNumber #assumes PhoneNumber but you can leave off #/fields/
      officeNumber:
        fieldDefinition: PhoneNumber
    associations:   
      department:
        defintion: Department
        
   Department:
       description: A department of a company 
       fields:
          id:
            field: UUID 
          name: 
            field: Name
            description: Name of department 
          manager: 
            field: Employee

       associations:
         manager:
           defintion : Employee
         employees:
           defintion: [Employee]

RDBMS-MIXIN.yaml Example mixin

module-namespace: MySQL 

Relationships:
  Employee:
    generate: 
        field: id
    manyToOne: 
        field: department
        model: Company/Department
        fk: departmentId # Can be written as Company/Employee/departmentId
        key: id # Can be written as Company/Department/id
        tags: [*] #load department info on all views 

  Depatment:
    generate: 
        field: id
    oneToMany: 
        field: employees
        model: Company/Employee 
        fk: Company/Employee/departmentId  # Company/Employee is optional and is assumed 
        key: Company/Department/id  # Company/Department/
        tags: [nested] #load employees info on only nested calls 
   
    oneToOne: 
        field: manager
        model: Company/Employee 
        fk: Company/Department/managerId 
        key: Company/Employee/id
        tags: [nested] #load employees info on only nested calls      

This is very rough.

DOCUMENT-MIXIN.yaml Example mixin

module-namespace: Cassandra

Documents:
  Department:
    triggerModel: Department
    type: Primary 
    fields: [name, manager, id, employees]
  DepartmentShallow:
    triggerModel: Department
    type: View 
    fiels: [name, managerName:manager.name, id]
  
  Employee:
    triggerModel: Employee
    type: Primary 
    partitionKey: id 
    fields: [firstName, lastName, id, department]  
   
  EmployeeView:
    triggerModel: Employee
    type: View 
    partitionKey: [lastName, firstName]
    fields: [firstName, lastName, id, departmentName: department.name, departmentId, department.id, managerName: department.manager.name]    

This is very rough.

acl.yaml

module-namespace: BaseRoles 


roles:
  Admin:
    name: admin
    description: admin 
    active-tags : [admin]
    rulesets: [admin]
  
  User:
    name: user
    description: normal user
    rulesets: [user]
    properties:
      employeeId: Company/UUID
    
# Currently two types of resources Model (data model) and Path (URL path to front end).     
rulesets:
    admin:
      'Model/Company/Employee':
          effect: Allow
          resource: Model/Company/Employee # (default is to use the name as the resource)
          action: [Create, Read, Update, Delete]
      
      'Company/Department':
          effect: Allow
          actions: [Create, Read, Update, Delete]
      
    user: 
      'Company/Employee':
          effect: Allow #default is Allow
          actions: [Read, Update]
          conditions: 
            - 'principal.employeeId=this.id'
      
      'Company/Department':
          actions: [Read, Update]
          conditions: 
            [principal.employeeId=this.manager.id]
          
      
      'Company/Employee':
          actions: [Read]
          roles: [#roles:User]
      
      'Company/Department':
          actions: [Read]
You might also like...
Kotrlin Programming Language Cross-Platform Development which includes Android, iOS and Backend. Pretty much everwhere.
Kotrlin Programming Language Cross-Platform Development which includes Android, iOS and Backend. Pretty much everwhere.

Kotlin-Everywhere: Kotlin Programming Language Cross-Platform Development This is still a WIP but the idea is to create a tiny KOTLIN project that cou

Blog Backend Api built with Kotlin, Springboot and AWS

Kotlin, Spring Boot, MySQL, JPA, Hibernate Rest API for Blogs A Restful CRUD API using Kotlin, Spring Boot, Mysql, JPA and Hibernate hosted on AWS Ela

Backend coding challenge using Kotlin and Ktor

Backend Coding Challenge We appreciate you taking the time to participate and su

Kbackend - A simple backend library for creating backends in Kotlin/Java

kbackend A simple backend library for creating backends in Kotlin/Java Setup Thi

Android login spring - Android login against spring backend

Android Jetpack Compose login implementation with JWT tokens against our own bac

A small backend for the Thinkrchive app written in Kotlin with Ktor

A small backend for the Thinkrchive app written in Kotlin with Ktor. It uses Postgresql with a few requests and JWT authentication for admins.

Mock up social media android application created to interact with a backend Java server using GraphQL.

The Community Board Project Authorship: author: dnglokpor date: may 2022 Project Summary: The Community Board Project consists of a Java Spring Boot b

Android Note app that uses the "ktor-note-app" backend

KtorNoteApp Android Notes app that uses Ktor back end server Technologies employed: Kotlin MVVM Coroutines Custom REST API build with Ktor Responds to

This project acts as a backend to the zhi-dao android app

This project acts as backend to the Zhi-Dao android app (currently in progress) which is a restaurants guide app.

Owner
Richard Hightower
One of the primary developers on QBit Microservices Lib, Reakt Reactive Java Lib, Boon, Slumber DB and more.
Richard Hightower
Backend aio - A project made to help all newbie programmers that are approaching backend development

BackendAIO A ktor based ready to use backend BackendAIO is a project made to hel

Fabrizio Scarponi 4 Feb 1, 2022
A backend service that generates a random 32-chars length message and its sha256 hashcode and put them to DB

This is an Android application in which a user can ask the server to generate a random message and its sha256, and ask to obtain this info from the server.

Iskander 1 Nov 20, 2022
Team management service is a production ready and fully tested service that can be used as a template for a microservices development.

team-mgmt-service Description Team management service is a production ready and fully tested service that can be used as a template for a microservice

Albert Llousas Ortiz 18 Oct 10, 2022
Accessibility-Service - Filter url from browser by using accessibility service

Accessibility Service example Filter url from browser by using accessibility ser

AmirMohammad Yazdanmanesh 8 Nov 29, 2022
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT ??️ NotyKT is the complete Kotlin-stack note taking ??️ application ?? built to demonstrate a use of Kotlin programming language in server-side

Shreyas Patil 1.4k Dec 26, 2022
It is a repository containing backend structure for Ktor.

Backend Architecture with Ktor + KMongo This project contains, Authentication using Jwt Database Layer (KMongo - Orm for MongoDB) Routing Advanced Rou

Himanshu Singh 56 Dec 28, 2022
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, KGraphQL/GraphQL generated endpoints, Gradle.

Kotlin Clean Architecture Backend Kotlin backend based on the Clean Architecture principles. The application is separated into three modules: Domain,

null 255 Jan 3, 2023
🧙 Sharding backend infrastructure for Nino v2, handles as a sharding operator for Nino.

shibe ?? Sharding backend infrastructure for Nino v2, handles as a sharding operator for Nino. Why? I feel like this was needed because I wanted to ke

Nino 3 Aug 9, 2021
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
A sample skeleton backend app built using Spring Boot kotlin, Expedia Kotlin Graphql, Reactive Web that can be deployed to Google App Engine Flexible environmennt

spring-kotlin-gql-gae This is a sample skeleton of a backend app that was built using: Spring Boot(Kotlin) Reactive Web Sprinng Data R2DBC with MYSQL

Dario Mungoi 7 Sep 17, 2022