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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nestjs-starter

v0.1.5

Published

Get started for beginners with Nestjs

Readme

Description

This project for beginners made of Nest combined with some powerful libraries such as: Fastify, Sequelize, JWT... written in Typescript and uses PostgreSQL as the database.

Introduction

This source code to help you get started with Nestjs.

Installation

Source code works on Node version 14.17.1 and Yarn version 1.22.10. If you don't have it, install it first. The setup and startup steps I describe in the Installation section.

1. Open Git bash.
2. git clone https://github.com/pktai/nestjs-starter.git.
3. cd nestjs-starter.
4. yarn. // install library.
5. setup .env file. Please open the file `env.example` and set the environment variables properly.

Below are the variables in env.


NODE_ENV=development

DB_DIALECT=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=language
DB_HOST=127.0.0.1
DB_PORT=5432

SECRET_TOKEN=jsonwebtoken
EXPIRESIN_ACCESS_TOKEN=5m
EXPIRESIN_REFRESH_TOKEN=15m

RATE_LIMIT_TIME_WINDOW=30000
RATE_LIMIT_MAX=100
DEFAULT_LIMIT_PAGE=10

SERVICE_PORT=3001
SERVICE_NAME='0.0.0.0'
MONGO_DB=mongodb://localhost:27017/?readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

Before running the test command. you need to run command yarn db:migrate to init data

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Describe

.
├───.github
│   └───workflows
├───.husky
│   └───_
├───.vscode
├───assets
├───db
│   ├───migrations
│   └───seeders
├───src
│   ├───entities
│   ├───modules
│   │   ├───auth
│   │   │   ├───dto
│   │   │   └───roles
│   │   ├───database
│   │   ├───language
│   │   │   └───dto
│   │   └───user
│   │       └───dto
│   └───shared
│       ├───config
│       │   └───interfaces
│       ├───errors
│       ├───filters
│       ├───interfaces
│       ├───models
│       ├───paginate
│       │   └───interfaces
│       └───utils
└───tests
    ├───auth
    ├───database
    ├───languages
    ├───shared
    └───users

Coverage test results

To prove the source code is really good. I have set up and run unit tests almost all the functionality in the source code. below are the results.


----------------------------------|---------|----------|---------|---------|-------------------
File                              | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------------------------------|---------|----------|---------|---------|-------------------
All files                         |   97.67 |    93.55 |     100 |    97.4 |                   
 src/entities                     |     100 |      100 |     100 |     100 |                   
  index.ts                        |     100 |      100 |     100 |     100 |                   
  languages.ts                    |     100 |      100 |     100 |     100 |                   
  users.ts                        |     100 |      100 |     100 |     100 |                   
 src/modules/auth                 |     100 |      100 |     100 |     100 | 
  auth.controller.ts              |     100 |      100 |     100 |     100 | 
  auth.module.ts                  |     100 |      100 |     100 |     100 | 
  auth.service.ts                 |     100 |      100 |     100 |     100 | 
  jwt-auth.guard.ts               |     100 |      100 |     100 |     100 | 
  jwt.strategy.ts                 |     100 |      100 |     100 |     100 | 
 src/modules/auth/dto             |     100 |      100 |     100 |     100 | 
  create-session.ts               |     100 |      100 |     100 |     100 | 
  update-session.ts               |     100 |      100 |     100 |     100 | 
 src/modules/auth/roles           |     100 |      100 |     100 |     100 | 
  roles.decorator.ts              |     100 |      100 |     100 |     100 | 
  roles.enum.ts                   |     100 |      100 |     100 |     100 | 
 src/modules/database             |     100 |      100 |     100 |     100 | 
  UnitOfWork.ts                   |     100 |      100 |     100 |     100 | 
  database.module.ts              |     100 |      100 |     100 |     100 | 
  database.provider.ts            |     100 |      100 |     100 |     100 | 
  repository.database.provider.ts |     100 |      100 |     100 |     100 | 
 src/modules/language             |     100 |      100 |     100 |     100 | 
  language.controller.ts          |     100 |      100 |     100 |     100 | 
  language.module.ts              |     100 |      100 |     100 |     100 | 
  language.service.ts             |     100 |      100 |     100 |     100 | 
 src/modules/language/dto         |     100 |      100 |     100 |     100 | 
  index.ts                        |     100 |      100 |     100 |     100 | 
  query-language.ts               |     100 |      100 |     100 |     100 | 
  remove-language.ts              |     100 |      100 |     100 |     100 | 
  upsert-language.ts              |     100 |      100 |     100 |     100 | 
 src/modules/user                 |     100 |      100 |     100 |     100 | 
  user.controller.ts              |     100 |      100 |     100 |     100 | 
  user.module.ts                  |     100 |      100 |     100 |     100 | 
  user.service.ts                 |     100 |      100 |     100 |     100 | 
 src/modules/user/dto             |     100 |      100 |     100 |     100 | 
  create-user.ts                  |     100 |      100 |     100 |     100 | 
  index.ts                        |     100 |      100 |     100 |     100 | 
 src/shared                       |     100 |      100 |     100 |     100 | 
  index.ts                        |     100 |      100 |     100 |     100 | 
 src/shared/config                |     100 |      100 |     100 |     100 | 
  database.ts                     |     100 |      100 |     100 |     100 | 
  error-message.ts                |     100 |      100 |     100 |     100 | 
 src/shared/errors                |     100 |      100 |     100 |     100 | 
  index.ts                        |     100 |      100 |     100 |     100 | 
  message-code-error.ts           |     100 |      100 |     100 |     100 | 
 src/shared/filters               |   76.74 |       60 |     100 |   75.61 | 
  dispatch-error.ts               |   76.74 |       60 |     100 |   75.61 | 43-52,86,105     
 src/shared/paginate              |     100 |      100 |     100 |     100 | 
  index.ts                        |     100 |      100 |     100 |     100 | 
  paginate.ts                     |     100 |      100 |     100 |     100 | 
  pagination.ts                   |     100 |      100 |     100 |     100 | 
 src/shared/utils                 |     100 |      100 |     100 |     100 | 
  crypto.ts                       |     100 |      100 |     100 |     100 | 
  reponse.ts                      |     100 |      100 |     100 |     100 | 
 tests/auth                       |     100 |      100 |     100 |     100 | 
  data-example.ts                 |     100 |      100 |     100 |     100 | 
 tests/languages                  |     100 |      100 |     100 |     100 | 
  data-example.ts                 |     100 |      100 |     100 |     100 | 
 tests/users                      |     100 |      100 |     100 |     100 | 
  data-example.ts                 |     100 |      100 |     100 |     100 | 
----------------------------------|---------|----------|---------|---------|-------------------

Test Suites: 6 passed, 6 total
Tests:       24 passed, 24 total
Snapshots:   0 total
Time:        8.371 s
Ran all test suites.
Done in 9.07s.

Support

If there is a problem in the source code, please open the Issues tab or click here. I'm really grateful to the contributors. It motivates me to go further.

Stay in touch

License

MIT licensed.