Giter Site home page Giter Site logo

rebar3_nova's People

Contributors

burbas avatar buurbas avatar dumbbell avatar kivradawi avatar ruipserra avatar taure avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rebar3_nova's Issues

Function to return information about plugins

Today we actually have structure defined in a nova-plugin to return information such as options, intent etc. The problem is that this information is not viewable other than in code.

We should build a function so that one can actually get the information outputted into human-readable text.

Add a CRUD template to the templates

I think it would be a lot more intuitive to understand and use nova if it could come with a template with the basic CRUD operations over a given domain model , so that the user could see how can he define the different exposed methods using either querystring or json.
Ideally the template could also contain the code to decode (using a serializer) and fetch some fields of the json
and also the code in order to encode back and send the json response.

The template could include a controller with the methods

  • GET (querystring , responds in json)
  • POST (receives json , responds in json)
  • PUT (receives json , responds in json)
  • DELETE (receives query string , responds with status or whatever)
-module(pet_controller).
-export([get/1, create/1, delete/1,update/1]).

get(Req=#{bindings := #{<<"id">> := Id}})->
   .....
   Pet= fetch_pet_from_somewhere(Id),
   Encode= thoas:encode(Pet),
   {json,200,#{},Encode}.

get(Req=#{parsed_qs:= #{<<"id">> := Id}})->
   .....
   Pet= fetch_pet_from_somewhere(Id),
   Encode= thoas:encode(Pet),
   {json,200,#{},Encode}.

create(Req=#{json := { <<"id">> := Id , <<"hair_color">> := HairColor } })->
    insert_to_db(Req),
     {json,200,#{},<<"created">>}.

update(Req=#{json := { <<"id">> := Id , <<"hair_color">> := HairColor } })->
    update_to_db(Req),
     {json,200,#{},<<"updated">>}.

delete(Req=#{parsed_qs:= { <<"id">> := Id } })->
    delete(Req),
     {json,200,#{},<<"deleted">>}.  
 

The datalayer could just be a mock or another module with undefined methods or just some constant in the method , it doesn't rlly matter but the important part is for the new user to see how he handles json/binding/querystring, serialization,deserialization , json deconstruction (fetching particular fields)

And ideally this template could just be started and checked out with swagger.

P.S The idea came from C# where there are a couple of web api templates pic related
image

Originally posted by @sanzor in novaframework/nova#217

Templating a new repo and make a release

After update with flatlog and we create a release that we try to start we get this error:

Exec: /usr/local/lib/erlang/erts-12.0/bin/erlexec -boot /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/local/lib/erlang/lib -config /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/sys.config -args_file /home/daniel/project/test/_build/default/rel/test/releases/0.1.0/vm.args -- console
Root: /home/daniel/project/test/_build/default/rel/test
/home/daniel/project/test/_build/default/rel/test
{"could not start kernel pid",application_controller,"invalid config data: application: kernel; invalid parameter: #{formatter =>\n      {flatlog,#{colored => true,map_depth => 3,\n                 template =>\n                     [colored_start,\"[\e[1m\",level,\"\e[0m\",colored_start,\n                      \"] [\",time,\"]\",colored_end,\" \",msg,\" (\",mfa,\")\n\"],\n                 term_depth => 50}}}"}
could not start kernel pid (application_controller) (invalid config data: application: kernel; invalid parameter: #{formatter =>
      {flatlog,#{colored => true,map_depth => 3,
                 temp

Add favicon to template

We should add a favicon to html templating for a new repo.

Now we get a 404 on favicon when we template a new repo and point the browser to the start page.

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.