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

tankit

v1.0.9

Published

A script that will boot strap a node.ts Prisma MySql Api.

Downloads

10

Readme

Node.js + Prisma + MySQL Project Setup Script

Getting Started

After installing Tankit, you can easily initialize a new project with all the necessary configurations for Node.js, Prisma, and MySQL, including TypeScript, Prettier, and ESLint setups.

Prerequisites

Ensure you have Node.js, jq, Homebrew (for macOS), pnpm, and MySQL server installed on your machine.

Initialize a New Project

Run the following command in your terminal:

npx tankit-init

This script is a bash script used to automatically generate a new project using Node.js, Prisma ORM, and MySQL database. The script includes necessary configurations for TypeScript, Prettier, and ESLint. It also generates a basic user authentication mechanism with hashed passwords. This makes it easier to get started, and you can change to RDS / Plant Scale later

The script does the following in order:

  1. Prompts the user for project name and path.
  2. Checks for the presence of jq, a command-line JSON processor. If not present, the script offers to install it.
  3. Checks for the directory where the project should be created. If the user does not provide one, the script uses the current directory.
  4. Prompts the user for MySQL credentials and database name. If not provided, the script uses default values.
  5. Creates a new Node.js project using pnpm init.
  6. Installs required project dependencies and devDependencies, including Express, jsonwebtoken, Prisma, TypeScript, and more.
  7. Initializes Prisma with MySQL as the data source provider.
  8. Writes the database connection URL to a .env file.
  9. Adds a User model to Prisma's schema file.
  10. Installs and configures ESLint and Prettier for code formatting and linting.
  11. Configures TypeScript for the project.
  12. Generates Prisma client using npx prisma migrate dev --name init.
  13. Creates the necessary directory structure for the project.
  14. Adds middleware for a single Prisma instance, password hashing, and authentication.
  15. Creates a user router for user-related routes.

The script also has necessary error checks in place to ensure that operations are successful before proceeding to the next step.

Prerequisites

The script requires the following installed on your machine:

  • Node.js and npm
  • jq
  • Homebrew
  • pnpm
  • MySQL server

Usage

  • Download or clone the bash script to your local machine.
  • Run the script using the command bash init_project.sh.

The script will guide you through the rest of the process via prompts.

Note

This script assumes you are using macOS or a Linux-based operating system. For other operating systems, you may need to modify the script to match your environment.

Caution

The script will install packages globally on your machine if they are not found, including jq and Homebrew. Make sure you are comfortable with this before running the script.

Contribution

Contributions are always welcome! Please submit a PR if you have any improvements or feature additions.