Git Product home page Git Product logo

wertik-js's Introduction

Wertik-JS V3

Wertik is a tiny Node JS framework that helps you set up servers with support for

  • MySQL Database
  • Emailing
  • GraphQL
  • Modules
  • Rest Api
  • Storage
  • Sockets
  • Cron Jobs
  • Redis
  • Logger

Installation

You can install wertik-js by using yarn or npm:

Yarn

yarn add wertik-js

Npm

npm install wertik-js

Setting up server

To start wertik-js server you need to import wertik and start it:

import wertik from "wertik-js/lib/"

weritk({
  port: 1200,
})

In your console you will see something like this:

Wertik JS app listening at http://localhost:1200

If you visit http://localhost:1200, you will see a response like this:

Cannot GET /

πŸš€ You have successfully started wertik server. There is nothing in wertik app right now. Let's make it interactive by adding:

  • MySQL Database
  • Mailer
  • GraphQL
  • Modules
  • Rest Api
  • Storage
  • Sockets
  • Cron Jobs
  • Redis

Accessing Wertik Inside GraphQL Resolver and Express Handler

You can access Wertik instance inside GraphQL and Express handler through:

  • Express
app.get("/somepath", (req, res) => {
  console.log(req.wertik) // Wertik App
  res.send("Some Info")
})

For more please see This line.

  • GraphQL Resolver
function Resolver(_, args, context, info) => {
  console.log(context.wertik); // Wertik App
  return "Some Info"
}

For more please see: This line

With keyword Wertik you can access everything that lies inside wertik from database, modules, sockets, mailer, cron jobs to everything in Wertik app.

Why you should use Wertik JS

Wertik JS lightens up your app with different features, Wertik can be helpful for small projects such as task management or a blog application. With modules with Wertik JS, you can easily create modules with crud operations. Furthermore, Wertik JS can lighten up your app with useful features such as Redis, Sockets, Database such as Mysql, Queue Management, Storage, Cron Jobs, and other useful features.

How Wertik JS works internally

Wertik JS v3 is setup in a clean way and easy way. Here is the main file which initializes Wertik JS: Show File.

You can check the code and if you find something that needs to be changed, you can create a new Issue here.

Did you find a grammatical mistake in the documentation?

If you came across a grammatical mistake please create a new issue with more details in the description: here.

Contribute & Support

Pull requests are welcome. If you have discovered a bug or have a feature suggestion, feel free to create an issue on GitHub.

If you'd like to make some changes yourself, see the following:

  • Fork this repository to your own GitHub account and then clone it to your local device
  • Make sure yarn is globally installed (npm install -g yarn)
  • Run yarn to download required packages.
  • Build and start the application: yarn dev-next
  • If you contributed something new, run yarn contrib:add to add yourself to the contributors list
  • Finally, submit a pull request with your changes!

wertik-js's People

Contributors

arshad03490 avatar dependabot[bot] avatar hakeem-sardar avatar ilyas-wm4d avatar ilyaskarim avatar naveedharri avatar pervaizdattoo avatar qasim149 avatar waseembarcha avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wertik-js's Issues

Use all table names and column names into underscored

Is your feature request related to a problem? Please describe.
Use all table names and column names into underscored like userRole must be user_role, userId must be user_id and forgetPassword must be forget_password

How to send email?

I was going through this library and Is there any function to send emails with templates option?

Suggestions

This is not an issue, But you can write a comment regarding a new feature in our boilerplate.

Context should also send roles for user on each request.

Is your feature request related to a problem? Please describe.
Currently, wertik-js only sends permissions, it could be great if it could send roles for a user.

Describe the solution you'd like
On each request, the context should also send assigned roles to the user.

Describe alternatives you've considered
No alternatives.

Additional context
No, it is easy to understand.

Add auth in frontend react app

Is your feature request related to a problem? Please describe.
No problem but a enahance to frontend app.

Describe the solution you'd like
A frontend app is provided and you have to setup auth in the frontend app.

Describe alternatives you've considered
No alternative

Additional context
See GraphQL mutations

Hasura Integration

Is your feature request related to a problem? Please describe.
It is not a problem.

Describe the solution you'd like
Please integrate Hasura.

Additional context
Hasura is same as Apollo GraphQL, It could be great if you could integrate Hasura in Wertik-js.

Allow login from another table

Is your feature request related to a problem? Please describe.
Sometimes we need to login through another table, This option is required.

Describe the solution you'd like
There must be a mutation called LoginAs and we can pass args and tableName so we can login in to it as that table. Like there is a client table, There must be a Mutation to login it as loginasClient.

Write Documentation in library as well

Is your feature request related to a problem? Please describe.
Move Documentation from Wapgee to Wertik

Steps

  1. Create a folder called docs
  2. Write doc in MD files.

Allow searching a model by its id

Is your feature request related to a problem? Please describe.
Allow searching a model by its id, For example, Role, It should be RoleByPk or RoleById

Setup proper email in Wertik-js

Is your feature request related to a problem? Please describe.
Email feature is works with fake mailer, Please setup proper email in Wertik-js.

Allow importing library by easy way.

Is your feature request related to a problem? Please describe.
Currently, the library can be imported wertik-js/lib/, allow importing it from the root.

Generate rest api docs

Is your feature request related to a problem? Please describe.
Currently, the API docs are not being generated.

Describe the solution you'd like
The API docs should be generated to make it easy for devs to see all APIs.

Allow cron jobs feature.

Is your feature request related to a problem? Please describe.
Allow cron jobs feature.

Describe the solution you'd like
For backend SaaS application Cron job feature is very important. So it could be great if there is a cron job feature.

snakeCase(tableName) function in loadtables.js is not working properly

Describe the bug
snakeCase(tableName) function in loadtables.js is not working properly. When table name is reviewType and it assigns a table name as review_type so this is not correct.

Solution
Make a new property in a module object called tableName and make it required to use it as a table name. The option must be under database.sql.tableName

Sorting feature is missing from list feature

Is your feature request related to a problem? Please describe.
Sorting feature is missing from list feature

Describe the solution you'd like
Please add sorting feature to list.

There should be a function to that can also generate context from user end.

Is your feature request related to a problem? Please describe.
Currently wertik handles context creation by itself, There should be a function to that can also generate context from user end.

Describe the solution you'd like
There should be a function to that can also generate context from user end.

Describe alternatives you've considered
No

Additional context
No

Allow storage feature

Is your feature request related to a problem? Please describe.
Allow uploading feature. Uploading should be done from atleast:

  1. Rest Api
  2. GraphQL.

Describe the solution you'd like
Use multer-js to upload documents.

Describe alternatives you've considered
formidable

Exposed mongodb credentials

Potential security breach. Verified credentials in URL *redacted*:*redacted*@ds027719.mlab.com in file \examples\demo\index.js

You should recycle your credentials immediately and move secrets to environment variables to prevent them being committed to GitHub.

Make app initialize like express js

The goal of this task is to convert initializing into express like system.

Benefits:

  1. It will allow users to upgrade to the latest version without any conflicts.
  2. Simple code splitting
  3. Faster coding

Return stats after executing a database query

Is your feature request related to a problem? Please describe.
Currently only returning item, now return stats after executing a query, For example for bulk create it was:

BulkCreateRole: [Role]

Now it should return items with rows effected and other stats, Like for BulkCreateRole, it should be

BulkCreateRole: {
rows_efftected: Int
rows: [Role]
}

Same goes for Rest API.

MongoDB Support

Is your feature request related to a problem? Please describe.
Please support MongoDB Support.

Describe the solution you'd like
Mongoose js

Describe alternatives you've considered
Nothing.

Additional context
Please allow using MongoDB.

GraphQL query to show all stats.

Issue having onboarding Wertik? We are here to help.

GraphQL or Rest API endpoint to show all stats. Like a number of Roles, Number of Users. A feature like statistics.

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.