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

create-backend-template

v1.1.6

Published

Backend temlate for nodeJS projects

Downloads

1

Readme

CREATE-BACKEND-TEMPLATE

This projects is an opinionanted way to bootstrap express API projects. It creates the project structure, sets up typescript, installs common (essential) dependencies, sets up linting and provides some scripts to get up and running easily.

This template is fully compatible with windows now.

(Hopefully it's simple and beginner friendly :) );

Make sure you have yarn and at least node 12 instaled

Get started

First of all run npx create-backend-template {projectName} to bootstrap your project

A .env file will be created for you by default, edit it with your basic info then run:

yarn dev

to start your server.

Available scripts

Dev

This script runs your typescript code with ts node and automatically restarts the server when there are changes to files.

yarn dev

Build

This script compiles your typescript code into javascript and stores it in the build folder. if there's not build folder, it creates one automatically for you.

yarn build

Start

This runs your javascript files directly. Use this command to run your servers in production.

yarn start

Migrate

Sequelize is used under the hood as an ORM & by default it's configured for postgres databases. This command runs all your sequelize migrations. You can also use migrate:u to undo last migration or migrate:u:a to undo all migrations

yarn migrate

yarn migrate:u

yarn migrate:u:a

Model

This creates a model for you using sequelize. It accepts the model name and attributes as parameters.

yarn model {modelNAme} --attributes {attrib}:{type}

N.B it similar to running: sequelize-cli model:generate --name {modelName} --attributes {attrib}:{type}

Migration

This creates a migration file for you using sequelize. It accepts the migration file name as a parameter.

yarn migration {create-tableName}

N.B it similar to running: sequelize-cli migration:create {create-tableName}

Deploy

This runs all the necessary commands to create a deployment.

yarn deploy

Documenting

Swagger is already set up and ready to use. Just include you docs under paths in src/swagger.ts Once done, hit /docs in your browser to see your swagger docs.

Dependencies

The following dependencies are installed along with the project.

  • axios
  • compression
  • cors
  • date-fns
  • dotenv
  • express
  • express-validator
  • helmet
  • jsonwebtoken
  • nanoid
  • pg
  • pg-hstore
  • sequelize
  • sequelize-cli
  • swagger-ui-express
  • express-rate-limit

Dev dependencies

  • @types/compression
  • @types/cors
  • @types/express
  • @types/express-rate-limit
  • @types/jsonwebtoken
  • @types/sequelize
  • eslint
  • eslint-config-airbnb-typescript
  • eslint-plugin-import
  • typescript

Contributing

Feel free to fork, open PRs and report issues. Any kind of feedback is appreciated.