npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zentinel-cli

v1.0.5

Published

<div align="center"> <h1 style="letter-spacing: 7px">ZENTINEL.JS</h1> </div>

Downloads

8

Readme

Zentinel.JS is a backend framework / boilerplate built on top of Express.JS, structured to mirror the Laravel directory format for a familiar setup. It includes Artisan-like commands called 'Zentinel' to streamline development tasks, offering a powerful toolset for efficient backend operations and seamless integration.

ExpressJS NodeJS

Table of Contents

  • Features
  • Installation
  • Environment Variables
  • Commands
  • Project Structure
  • API Documentation
  • Error Handling
  • Validation
  • Authentication
  • Authorization
  • Logging
  • Rate Limit
  • Socket / Realtime Data
  • Contributing

Features

Below are the features of Zentinel.JS:

  • Builtin Authentication using JSON Web Token.
  • Builtin Role-Based Access Control as Authorization.
  • Configured Mongoose for MongoDB
  • Configured Sequelize for MySQL
  • Configured CORS, Helmet and Securities
  • Interconnected MVC Components

Installation

Installation via CommandLine Interface

npm i zentinel-cli --global
zentinel init

  _____                 _     _                  _
 |__  /   ___   _ __   | |_  (_)  _ __     ___  | |
   / /   / _ \ | '_ \  | __| | | | '_ \   / _ \ | |
  / /_  |  __/ | | | | | |_  | | | | | | |  __/ | |
 /____|  \___| |_| |_|  \__| |_| |_| |_|  \___| |_|

? Do you want to initialize a new ZentinelJS project? Yes
? Please enter the name of the project: TestProject
✔  Fetched Server Files
✔  Git directory removed.
✔  Environment file set up.
✔  NPM packages installed successfully.
✔  Project initialized successfully!

cd TestProject
npx sequelize-cli db:migrate
npx sequelize-cli db:seed:all
zentinel dev

Manual Installation via Github: To install and start developing with Zentinel, follow these steps: Clone the repository:

git clone https://github.com/surelle-ha/zentineljs.git
cd zentineljs
npx rimraf ./.git

Navigate to the directory and install the dependencies using npm:

npm install

Set the environment variables

cp .env.example .env
# open .env and modify the environment variables (if needed)

Migrate Database

npx sequelize-cli db:migrate

Seed Default Data

npx sequelize-cli db:seed:all

Start Server

npm run dev

Commands

Create components using zentinel-cli

zentinel create
  _____                 _     _                  _
 |__  /   ___   _ __   | |_  (_)  _ __     ___  | |
   / /   / _ \ | '_ \  | __| | | | '_ \   / _ \ | |
  / /_  |  __/ | | | | | |_  | | | | | | |  __/ | |
 /____|  \___| |_| |_|  \__| |_| |_| |_|  \___| |_|

? Select component type to create (Use arrow keys)
❯ Controller
  Model
  Route
  Middleware
  All (Controller, Model, Route)

Run server

zentinel [dev/prod]

Create Seeder File

npx sequelize-cli seed:generate --name sample-seeder

Create Migration File

npx sequelize-cli migration:generate --name sample-migration

Recently Added

The Project is constantly being optimized and updated. Here are the new features I recently implemented.

  • [2024/06/06] Rate Limit - a mechanism used to control the number of requests a server receives within a certain period of time. It helps to prevent abuse, ensure fair usage, and protect the server from being overwhelmed by excessive requests, which could lead to performance degradation or denial of service.
/* Default Rate Limit Configuration */
const RateLimit = rateLimit({
    /* 15 minutes */
	windowMs: 15 * 60 * 1000, 

    /* Request Limit Per IP Per Window */
	limit: 100, 

    /* draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header */
	standardHeaders: 'draft-7',

    /* Disable the `X-RateLimit-*` headers */
	legacyHeaders: false, 
})
  • [2024/06/06] Sequelize ORM - Object/Relational Mapping (ORM) framework for Node. js applications. It enables JavaScript developers to work with relational databases, including support for features such as solid transaction support, relations, read replication, and more.
  • [2024/06/08] Zentinel CLI is a commandline interface tool to manager and initialize Zentinel Backend Boilerplate/Framework. To learn more about ZentinelJS, visit the repository.
npm i zentinel-cli
zentinel --help
zentinel init
zentinel create

Goal Checklist

  • [x] Add Rate Limit
  • [x] Integrate Mongoose ORM
  • [x] Integrate Sequelize ORM
  • [ ] Add Socket.io as Native Feature
  • [ ] Add Logger Utility
  • [x] Recreate Zentinel CLI
  • [x] Implement Migration and Seeding
  • [x] Publish zentinel-cli to NPM
  • [ ] Add Native Database Visualizer
  • [ ] Launch Documentation Page
  • [ ] Add Cron Job
  • [ ] Add Custom Function
  • [ ] Add Storage Driver Support

Developer

As a developer who constantly seeks to improve my development skills, my goal with Zentinel.JS is to create a powerful yet intuitive backend framework that simplifies the development process for fellow developers. I aim to provide a robust toolset that makes backend operations more efficient and enjoyable, ensuring that developers can focus on building great applications without getting bogged down by repetitive tasks.

I envision Zentinel.JS as a go-to framework for developers who appreciate the structure and convenience of Laravel but prefer to work within the Node.js ecosystem. By combining the best aspects of both worlds, I hope to foster a community where developers can share their experiences, contribute to the project's growth, and continuously improve their craft. Ultimately, Zentinel.JS will empower developers to create scalable, secure, and high-performance applications with ease, making backend development more accessible and enjoyable for everyone.

Developers

Surelle-ha - Github:: I'm currently looking for contributors to help improve project. Contact me on Linkedin, if you're interested.