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

@azera/stack

v1.2.1

Published

Azera Web Framework

Downloads

77

Readme

Azera Stack - A Full-Stack NodeJS Framework

A full-stack NodeJS Framework influenced by Symfony

Features

  • TypeScript
  • Bundle
  • Dependency Injection
  • Configuration
  • Decorators (Template, Routing, ...)
  • Cli Command
  • Maker (Controller, Entity, ...)
  • Simplicity
  • EventManager
  • Message Manager (Message-Queue, Email, SMS, ...)
  • SQL and NoSQL (TypeORM, Mongoose, MongoDb)
  • Authentication and Authorization
  • Http Client and HTML parser
  • Profiler
  • WorkFlow Manager
  • Proxy Manager
  • Meta-data Manager

Install

Execute this commands in your project directory :

# Initialize your project directory
yarn init

# Install Azera Stack module and initialize project structure
yarn add @azera/stack

# Build to generate dist from typescript files
yarn build

# Done !

Aftre than you will see this folder stucture in your directory :

- src
    - index.ts
- tests
- app.config.json
- tsconfig.json

Also cli, web, watch and build scripts will be added to your package.json , then add your first controller by next step.

Make Controller

Make a controller by following command :

yarn cli make:controller [Name] --path [Route path]

for example you may want to add Book controller :

yarn cli make:controller Book

it will generate BookController.ts with route path /book and add BookController to your app.config.json > services

Make Entity

# Make a TypeORM (SQL) entity :
yarn cli make:entity [Name]

# Make a TypeORM (Mongo) document :
yarn cli make:entity [Name] --mongo

Configuration

Azera stack is based on configuration file (default: "app.config.json"), many configuration and customization will be configured in that file. for example you may want to config your database connection :

// app.config.json
{
	"typeOrm": {
		"connections": {
            // You can have multiple different connections
			"app": {
				"database": "test",     // Database name
				"host": "127.0.0.1",    // Database Host
				"username": "test",     // Database username
				"password": "test",     // Database password
				"type": "mssql",        // Connection driver
				"entities": [
					"/entity/Book" // instead of "/src/entity/Book.ts"
				]
			}
        },
        // Default connection name
        "defaultConnection": "app"
	}
}

and you can use your entities in you application :

// src/controller/BookController.ts
import { Controller, Get, Inject, Param, Request, Response } from '@azera/stack';
import { EntityManager } from 'typeorm';
import { Book } from '../entity/Book';

@Controller('/book')
export class BookController {

    @Get('/') @Inject() async books(em: EntityManager) {
        return em.find(Book);
    }

    @Get('/book/:id') @Inject() async book(em: EntityManager, @Param() id: string) {
        return em.findOne(User, id);
    }

}

That's simple

Build your project

yarn build
# Or
yarn watch

Authors