+-+-+ +-+ +-+-+-+-+
|G|O| |4| |H|I|V|E|
+-+-+ +-+ +-+-+-+-+

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Xiara Application Framework Update

BY: @azarus | CREATED: Feb. 18, 2018, 9:40 p.m. | VOTES: 12 | PAYOUT: $90.85 | [ VOTE ]

In the past weeks i've been busy with the developement of the Xiara Application Framework.

About the project?

Xiara is a framework for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).

Under the hood, Xiara makes use of Express, allowing for easy use of the myriad third-party plugins which are available.
Xiara also features mongodb support out of the box

The framework is split up between multiple repositories:
https://github.com/azarus/xiara-core
https://github.com/azarus/xiara-web
https://github.com/azarus/xiara-mongo

And a boilerplate quickstart project:
https://github.com/azarus/xiara-boilerplate

Bug Fixes

New Features

A xiara web application with express & mongo is built up with the following components:

Modules: Are the root of the application
Submodules: Are the same as modules can import and export components

[IMAGE: https://camo.githubusercontent.com/0ab18cfc4f6353f5d495a9a12b7b1788f68ec1b6/68747470733a2f2f692e696d6775722e636f6d2f79595a317469622e706e67]

A simple Controllers Example

@Controller("/route")
class TestAPIController
{
    @GET("/getData")
    getData(req, res)
    {
      res.json({
        success: true
      })
    }
}

The above route defines the following HTTP end point
GET /route/getData

Policy

@Policy("Auth")
class AuthPolicy
{
    resolve(req, res, next)
    {
      // If logged in continue
      if(req.user)
      {
          return next();
      }
      res.forbidden("Login required");
    }
}

Responses

@Response("forbidden")
class ForbiddenResponse
{
    constructor(public message: string)
    {
    }

    send(req, res, next)
    {
      return res.json({
        success: false,
        message: this.message
      })
    }
}

Related Commits:

Xiara-Core
https://github.com/azarus/xiara-core/commit/f4f2feaf39c9f24bc2c3e3cee7f8c3f77ac54208
https://github.com/azarus/xiara-core/commit/32e321bc30d5931e493910fc70c912cbc7f05e65

Xiara-Mongo
https://github.com/azarus/xiara-mongo/commit/7b289c9c1e3420e5b7eff6924efa7d220907a20b#diff-2f8bbac3d76bf8fc13dca6e4ee6c4863

Xiara-Web
https://github.com/azarus/xiara-web/commit/2612670b19bc836058b8ac5d949321d5693e20c0

License

Mit

Got a question? Problem? Bug?

Please open an issue on github:
https://github.com/azarus/xiara-core

Posted on Utopian.io - Rewarding Open Source Contributors

TAGS: [ #utopian-io ] [ #xiara ] [ #nodejs ] [ #express ] [ #typescript ]

Replies

@codingdefined | Feb. 21, 2018, 2:46 p.m. | Votes: 1 | [ VOTE ]

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

@azarus | Feb. 21, 2018, 5:15 p.m. | Votes: 1 | [ VOTE ]

Thank you.

@utopian-io | Feb. 21, 2018, 10:06 p.m. | Votes: 1 | [ VOTE ]

Hey @azarus I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
- Vote for my Witness With SteemConnect
- Proxy vote to Utopian Witness with SteemConnect
- Or vote/proxy on Steemit Witnesses

[IMAGE: https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif]

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>