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

@nabadeep25/create-ts-node-app

v1.0.0

Published

A boilerplate/starter project for quickly building RESTful APIs using Node.js,Typescript, Express, and Sequelize.

Downloads

139

Readme

Typescript-Node-Sequelize-Boilerplate

A boilerplate/starter project for quickly building RESTful APIs using Node.js,Typescript, Express, and Sequelize.

  • Node
  • Typescript
  • Express
  • Sequelize (Oracle, Postgres, MySQL, MariaDB, SQLite and SQL Server etc.)

Table of Contents

Quick start

create boillerplate with single command

 npx  @nabadeep25/create-ts-node-app myapp

Manual Installation

steps:

Clone the repo:

git clone --depth 1 https://github.com/nabadeep25/typescript-node-sequelize-boilerplate.git  foldername

cd folder name
npx rimraf ./.git

Install the dependencies:

npm install

Set the environment variables:

cp .env.example .env

Getting started

npm install

npm run build-ts

npm start

For development

npm install

npm run dev

Sample .ENV

DB_HOST=localhost
DB_NAME=name
DB_PASSWORD=password
DB_PORT=3306
DB_TYPE=postgres
DB_USER=username
PORT=5000



TOKEN_EXPIRY_HOUR=168
SECRET=askjfghhwifuhgw

EMAIL_SERVICE=gmail
[email protected]
EMAIL_PASS=fzobeitqjcxklenm
[email protected]

OTP_EXPIRY_MIN=10
OTP_SECRET=shgdbnbgw

Commands

# run in development
npm run dev

# run in production
npm run start

#  lint files
npm run lint

#  format files
npm run format

Project Structure

dist\               # js files
src\
 |--config\         # Environment variables and configuration related things
 |--controllers\    # Route controllers 
 |--helpers\        # Helper function files
 |--middlewares\    # Custom express middlewares
 |--model\          # Sequelize models 
 |--routes\         # Routes
 |--services\       # Service 
 |--utils\          # Utility classes and functions
 |--validations\    # Request data validation schemas
 |--app.ts\         # Express app
 |--server.ts\      # App entry point

Changing Database

step 1

# Change the value of  DB_TYPE  in .env file to one of the follwing
DB_TYPE=postgres 
DB_TYPE=mysql 
DB_TYPE=sqlite 
DB_TYPE=mariadb 
DB_TYPE=mssql 
DB_TYPE=db2 
DB_TYPE=oracle 

step 2

# Install one of the related packge:
 npm install --save pg pg-hstore # for Postgres
 npm install --save mysql2 # for Mysql
 npm install --save mariadb # for Mariadb
 npm install --save sqlite3 # for Sqlite
 npm install --save tedious # for Microsoft SQL Server (mssql)
 npm install --save oracledb # for Oracle 

for more details please refer Sequelize

API Documentation

To view the list of available APIs and their specifications, run the server and go to http://localhost:5000/api/v1/docs in your browser. This documentation page is automatically generated using the swagger definitions written as comments in the route files.

API Endpoints

List of available routes:

General routes: GET api/ - get server status PATCH api/sync - Sync model with database

Auth routes: POST api/v1/auth/register - register POST api/v1/auth/login - login POST api/v1/auth/forgot-password - send reset password email POST api/v1/auth/reset-password - reset password

User routes: GET api/v1/user - get user info PATCH api/v1/user - update user

Inspirations