Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codespede/pwoli

Pwoli is a NodeJS/TypeScript framework written in TypeScript which can work independantly on a raw NodeJS/TypeScript environement OR, in co-ordination with any other frameworks or libraries like Express.js.
https://github.com/codespede/pwoli

activerecord dataprovider framework mongoose nodejs rest-api sequelize typescript

Last synced: 2 months ago
JSON representation

Pwoli is a NodeJS/TypeScript framework written in TypeScript which can work independantly on a raw NodeJS/TypeScript environement OR, in co-ordination with any other frameworks or libraries like Express.js.

Awesome Lists containing this project

README

        

[![Github All Releases](https://img.shields.io/npm/dt/pwoli.svg?label=Total%20Installs)]()

![npm](https://img.shields.io/npm/dw/pwoli?label=Weekly%20Installs)

https://codespede.github.io/pwoli

## Pwoli.js

Pwoli is a NodeJS/TypeScript framework written in TypeScript which can work independantly on a raw NodeJS/TypeScript environement 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](https://codespede.github.io/pwoli/api-docs/classes/ORMAdapter.html) and works with [Sequelize](https://sequelize.org) and [Mongoose](https://mongoosejs.com) out of the box at present by [SequelizeAdapter](https://codespede.github.io/pwoli/api-docs/classes/SequelizeAdapter.html) and [MongooseAdapter](https://codespede.github.io/pwoli/api-docs/classes/MongooseAdapter.html) 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._

_For any other DB/ORM support, an ORM Adapter implementing [IORMAdapter](https://codespede.github.io/pwoli/api-docs/interfaces/IORMAdapter.html) has to be implemented. Please see [how to use a different ORM](https://codespede.github.io/pwoli/using-another-orm)_

_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](https://codespede.github.io/pwoli/input-forms), [GridView, ListView](https://codespede.github.io/pwoli/output-data-widgets) for SSR(Server Side HTML Rendering) applications.
- [Simple-to-setup REST APIs](https://codespede.github.io/pwoli/rest-api) for the backends of SPA applications, Mobile apps and other API consumers.
- Works on both raw NodeJS and TypeScript applications.
- Has reasonable defaults.
- Well documented and [typed](https://www.typescriptlang.org) code for [IDE Intellisense](https://en.wikipedia.org/wiki/Intelligent_code_completion).
- Can be used in an ongoing project or a new project. Pwoli doesn't require that for using it, the project should be started from scratch.

### Installation

```markdown
npm install pwoli@latest
```

If you are using any ORM(like Mongoose) other than Sequelize, please [click here](https://codespede.github.io/pwoli/using-another-orm) to see details on how to configure it.
Enter these lines in your application's entry script(most probably index.ts or index.js)

```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 the backend for an SPA, Mobile App or a REST API client, [click here](https://codespede.github.io/pwoli/rest-api) 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](https://codespede.github.io/pwoli/output-data-widgets)
- [Data Providers - ActiveDataProvider, ArrayDataProvider](https://codespede.github.io/pwoli/output-data-providers)
- [Creating Forms - via ActiveForms](https://codespede.github.io/pwoli/input-forms)
- [Validating Input - via Model validations and ActiveForms](https://codespede.github.io/pwoli/input-validation)
- [Html helper - to help you do anything in the HTML side](https://codespede.github.io/pwoli/html-helper)
- [REST APIs - Data Rendering made easy with a few lines](https://codespede.github.io/pwoli/rest-api)
- [Using a different ORM - If you are using an ORM other than Sequelize](https://codespede.github.io/pwoli/using-another-orm)

### 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](https://github.com/codespede/pwoli-node-sample)
- [Sample App - Pwoli with TypeScript](https://github.com/codespede/pwoli-nodejs-typescript-sample)
- [Sample App - Pwoli with Express.js and NodeJS](https://github.com/codespede/pwoli-express-sample)
- [Sample App - Pwoli with Express.js and TypeScript](https://github.com/codespede/pwoli-express-typescript-sample)

### Credits

Pwoli is inspired from PHP's [Yii framework](https://www.yiiframework.com).

Kudos to [Mahesh](https://github.com/codespede), 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](https://github.com/yadavgoku) for his contributions to Pwoli.

### Tests

```
npm run test
```

More tests are invited as contributions!

### Contributing

The framework is [Open Source](LICENSE).

You may join us and:

- [Report an issue](https://github.com/codespede/pwoli/blob/master/docs/internals/report-an-issue.md)
- [Contribute to the core code or fix bugs](https://github.com/codespede/pwoli/blob/master/docs/internals/git-workflow.md)

### Support or Contact

Please feel free to shoot a mail to [email protected] for any queries or concerns.

We'll be starting our Slack channel soon where you can directly chat with us on clearing your queries.