Git Product home page Git Product logo

adent's Introduction

Adent

Drizzle is a flexible thin layer around SQL databases. Exma allows custom generators parsed data of loosely defined schema files. Next is a popular react meta framework that naturally works with serverless. Tailwind is a style engine using utility classes similar to bootstrap.

Adent is a content management framework; a stack using these four libraries to automatically create database models, server/graphql endpoints, pre-formed react components & pages, and auto tested content administration.

Install

$ npm i adent

1. Usage

In your root project, craete a file called schema.exma and paste the following.

plugin "adent" {
  lang "ts"
  engine "postgres"
  url "env(DATABASE_URL)"
  seed "env(SESSION_SEED)"
  modules "modules"
  router "pages"
  path "admin"
}

model Profile @label("User" "Users") {
  id          String   @label("ID") 
                       @id @default("cuid()")
  
  name        String   @label("Name") 
                       @searchable
                       @field.text
                       @is.required
                       @list.text @view.text

  image       String?  @label("Image") 
                       @field.url
                       @list.image(20 20) @view.image(100 100)
  
  description String?  @label("Description") 
                       @field.textarea
                       @list.none @view.text
  
  type        String   @label("Type") 
                       @default("person") 
                       @filterable
                       @field.text
                       @is.required
                       @list.lowercase @view.lowercase
  
  roles       String[] @label("Roles") 
                       @field.textlist
                       @view.tags
  
  tags        String[] @label("Tags") 
                       @field.tags
                       @view.tags
  
  references  Hash?    @label("References") 
                       @field.metadata
                       @view.metadata
  
  active      Boolean  @label("Active") 
                       @default(true) @filterable
                       @list.yesno @view.yesno
  
  created     DateTime @label("Created") 
                       @default("now()") @sortable
                       @list.date("m d, Y h:iA") 
                       @view.date("m d, Y h:iA")
  
  updated     DateTime @label("Updated") 
                       @default("now()") @timestamp @sortable
                       @list.date("m d, Y h:iA") 
                       @view.date("m d, Y h:iA")
  
  auth        Auth?        
  connections Connection[] 
  memberships Connection[] 
  files       File[]       
  addresses   Address[]    
}

Next run the following in your project root and wait for the output.

$ npx exma

This should create a modules folder in your project root.

adent's People

Contributors

cblanquera 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.