Pwoli.js
Pwoli is a NodeJS/TypeScript framework written in TypeScript which can work independantly on a raw NodeJS/TypeScript environment OR, in co-ordination with any other frameworks or libraries like Express.js.
Pwoli can connect to any kind of ORMs by implementing thier corresponding ORM Adapters and works with Sequelize and Mongoose out of the box at present by SequelizeAdapter and MongooseAdapter respectively.
This means that, all Mongoose and Sequelize supported databases like MongoDB, PostgreSQL, MySQL, MariaDB, SQLite, and Microsoft SQL Server are readily usable with Pwoli at present.
Pwoli means “super awesome” and our intention is to make web app development “super awesome”
A basic example of the API features provided by Pwoli:
A simple GridView:
A bit more complex GridView:
A simple ListView:
An example of ActiveForm’s capabilities:
Main Features
- Fully flexible and extensible - thanks to the OOP based architecture.
- Frontend widgets like ActiveForm, GridView, ListView for SSR(Server Side HTML Rendering) applications.
- Simple-to-setup REST APIs for the backends of Single Page Applications(like React, Angular, Vue etc.).
- Works on both NodeJS and TypeScript applications.
- Has reasonable defaults to get you started with little or zero config.
- Well documented and typed code for IDE Intellisense.
- You can use Pwoli on an ongoing project, and ofcourse you can start new projects with Pwoli.
Installation
//cd into the project directory
$ npm init //run this only if it's a new project/application.
$ npm install pwoli@latest
If you are using any ORM(like Mongoose) other than Sequelize, please click here to see details on how to configure it.
Enter these lines in your application’s entry script(most probably index.ts or index.js)
import { Application as Pwoli } from 'pwoli'; //if using ES6 modules or "type": "module" is set in your package.json
//if the above doesn't work, try the below two lines as you might be using CommonJS:
const pkg = require('pwoli'); //if using CommonJS
const Pwoli = pkg.Application;
// Pwoli is loaded!
// Now set the viewPath for finding the views:
// Please note: You don't need to set this if your application is just a REST API service
Pwoli.setViewPath(path.join(__dirname, 'views')); // The base path in which your view files are stored. Only applicable for SSR apps.
//You're ready to go!
Get Started
- Please note: If you are building an SPA or REST APIs, click here to jump to the tutorial on learning how to use Pwoli for rendering data from backend servers in a paginated, filtered and sorted manner for any model with the matter of a couple of lines of code.
Check out on one of our guides below for learning how to use Pwoli’s features:
- Data Widgets - GridViews, ListViews
- Data Providers - ActiveDataProvider, ArrayDataProvider
- Creating Forms - via ActiveForms
- Validating Input - via Model validations and ActiveForms
- Html helper - to help you do anything in the HTML side
- REST APIs - Data Rendering made easy with a few lines
- Using a different ORM - If you are using an ORM other than Sequelize
Try it out
We have made four sample apps in different environments for you to get started quickly by trying them out in your local:
- Sample App - Pwoli with NodeJS
- Sample App - Pwoli with TypeScript
- Sample App - Pwoli with Express.js and NodeJS
- Sample App - Pwoli with Express.js and TypeScript
Credits
Pwoli is inspired from PHP’s Yii framework.
Kudos to Mahesh, who is the brain behind Pwoli, and has high regards to Yii framework & he believes that this framework and its architecture has shaped his thoughts on modularized development methodologies.
Last but not least, thanks to Yadu Dev for his contributions to Pwoli.
Support or Contact
Please feel free to shoot a mail to codespede@gmail.com for any queries or concerns.
We’ll be starting our Slack channel soon where you can directly chat with us on clearing your queries.