Giter VIP home page Giter VIP logo

crudit's Introduction

Hi there ๐Ÿ‘‹

๐Ÿ‘‹ I'm a Opensource entusiast, DevOps lover that tries to build a better tomorrow.

Here are some ideas to get you started:

  • ๐Ÿ”ญ Invite me as a speaker to your event
  • ๐Ÿ’ฌ Ask me about DevOps, Cloud, and anything related with Opensource.
  • ๐Ÿ“ซ How to reach me: just drop me a message here
  • โšก Fun fact: I'm involved into opensource since 2006

Let's Connect โ˜•

LinkedIn Twitter Twitter

crudit's People

Contributors

zeppabot avatar zeppaman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

maxi032

crudit's Issues

Response adapter

Change the response option to be compatible with azure function and aws lambda. The option is to make the createResponse changeable by the user or pluggable.

Basically, we should have an intermediate step where we have the raw payload data with HTTP status and headers, then a function that converts to a response object.

Support schema mutation and data seeding

Most application needs adding mutation or data seeding. Example: create an index, fill the categories collection with a predefined set for categories.

We need to add this feature to crudy too.

How it should work:

import mutations form 'crudy' mutations.add('2202-08-21', function(database){ //do your staff return { hasError: true/false, error: "description } }); //other call of mutations.add('id of mutation', functiontoexecute); mutation. applyOne('id of the mutation'); //excete only one if not yet executed mutation.applyAll(); // apply all non done mutation one by one ordering by id
The mutation data have to be saved in that format

{
   _id, //internal id,
   mutationId, //the one chooses by user
  status, //todo, error, done
  dateApplied //when have been executed
 errorMessage
}

Acceptance test

  1. implement the library
  2. add 3 feature (each one adds a rows into a collection)
  3. run it => it should add the rows
  4. run it again => it should not do anything

implementation tips
use a mutation files that will be imported and used before express starts in dev.js

Support For Media Assets in Default Request

If there is a bucket registered, every assets in Byte64 passed in a request should be put in the registered bucket, and replaced with a reference to its address in the bucket

Settings loading

Managing all items in a single file is hard. The idea is to give three possibility to load each kind of settings (actually are: hooks, entities, requests,mutations).

For each one we must have three different ways for adding settings (image xxx is one of kind mentioned above):

  1. load object. The method has the key and the data that is stored into the object list.
credit.addXXX({object});

//example
crudit.addMutation({
            name: "xxx",
            function: ()=>{},
            dbName: "xxx"
        });
  1. shortucut. wrapper of the above, but passing parameters in the method variables
credit.XXX(arg1,arg2.arg.3);

//example
crudit.mutation( "xxx", ()=>{}, "xxx");
  1. shortucut. wrapper of the above, but from file. Each file will contains the export of alist of object to be merge.
credit.loadXXX(path);

path specifications:

  • if path is a file load all items inside and merge with settings
  • if path is a folder, load all files (each one can contains multiple settings) and append to the configuration object

Mongo DB Connection

Expose connection parameters for changing connection pool settings. Define how to dispose of connections in serverless and standalone servers. The connection must be closed at application shutdown but stay live for the application duration.

Data validation

Add the opportunity of implementing data validation by describing your entities (no code)
Step 1
Each entity can be configured as usual by adding the settings:

crudy.configEntity('myEntityName',function(config){
    config.roles=['owner'];
  });

One of the items of config item is validation. The item is an object with the rules given by validatorjs (https://www.npmjs.com/package/validatorjs).

This give the opportunity of having the validation settings available on each phase of the saving.

Step 2
add a hook that acts on pre save event. The piece of code will be executed before ALL items are saved. Then, you can implement logic:

  1. get validation data for the entity
  2. apply validation
  3. if ok do nothing, otherwise throw an error

Refactoring database.mjs

Change it from object to class or function. The goal is to use the database class like

let xxx = new Database(args);
xxx.destroy();

the constructor arguments are the same of init method.

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.