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-universalstack

v1.0.1

Published

UniversalStack is a CLI tool for setting up full-stack applications with a customizable configuration. It generates a Vite + React frontend and optionally sets up an Express backend with MongoDB or MySQL support. Additional features include Tailwind CSS,

Downloads

149

Readme

UniversalStack v1.0.1

UniversalStack is a command-line utility for rapidly setting up a full-stack web application using Vite, React, and Express. It allows you to scaffold projects with optional configurations like Tailwind CSS, React Router, and an Express backend with MySQL or MongoDB support.

Features

  • Streamlined Setup: Quickly create a Vite + React project with selected add-ons.
  • Customizable Configurations: Choose between JavaScript or TypeScript.
  • Backend with Express: Optionally set up an Express backend with custom server file names.
  • Database Integration: Supports MySQL or MongoDB, creating connection files automatically.
  • Environment Management: Generates a .env file with initial configurations.
  • Enhanced Project Structure: Organizes files for controllers, routes, services, and database connections for maintainable code.

Installation

To use UniversalStack, you can either install it globally or run it directly with npx.

Global Installation

Install the package globally:

npm install -g create-universalstack

After installation, initiate the setup with:

npm create universalstack

Using npx

Alternatively, use npx to run UniversalStack without a global installation:

npx create-universalstack

Usage

To start creating a project, run:

npm create universalstack

Prompts

You will be guided through configuration prompts:

  • Project Name: Name your project.
  • Language: Choose JavaScript or TypeScript.
  • Add Tailwind CSS: Include Tailwind CSS if desired.
  • Add React Router: Optionally add React Router.
  • Set Up Express Backend: Opt-in to create an Express backend.
  • Database Choice: If an Express backend is chosen, select either MySQL or MongoDB.

Example

$ npm create universalstack
✔ Enter your project name: my-awesome-project
✔ Select the Vite + React variant: TypeScript
✔ Do you want to add Tailwind CSS? Yes
✔ Do you want to add React Router? Yes
✔ Do you want to set up an Express backend? Yes
✔ Enter the name of the server file (default: server.js): server.js
✔ Choose the database to use: MySQL

Project Structure

After setup, your project will have the following structure:

my-awesome-project/
├── backend/
│   ├── controllers/
│   │   └── sampleController.js
│   ├── db/
│   │   ├── mysqlConnection.js  // or mongoConnection.js for MongoDB
│   ├── models/
│   │   └── sampleModel.js
│   ├── routes/
│   │   └── sampleRoute.js
│   ├── .env
│   ├── server.js
│   └── package.json
└── src/
    ├── App.tsx
    └── main.tsx

Dependencies

Dependencies are installed based on the configuration selected:

For Express backend:

  • express
  • cors
  • dotenv
  • nodemon
  • mysql2 (for MySQL) or mongoose (for MongoDB)

Frontend Add-Ons:

  • tailwindcss if Tailwind CSS is selected.
  • react-router-dom if React Router is selected.

ESLint Configuration

To keep frontend and backend code linted separately, the backend directory is ignored by default.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Open an issue or submit a pull request for new features or improvements.