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

@mhmurad/respa-back

v1.0.5

Published

A package to create a React back-end project structure

Downloads

351

Readme

React-Structure-Package-Backend

  • Before you start create this first:
mkdir name-of-your-project
# follow prompts
cd your-new-project-directory
  • And then run this:
npx @mhmurad/respa-back init
  • Before you run your server do this first:
// index.js

// please check your own mongodb cluster and embed the only code after @cluster0.yourCode and put it in this uri and also change DB_USER,DB_PASS in .env file

// change the inside bracket() to {}.

const uri = ${`mongodb+srv://$(process.env.DB_USER):$(process.env.DB_PASS)@cluster0.yourCode.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0`};

react-structure-package-backend(respa-back) is a Node.js package that helps you quickly set up a React back-end project structure with essential files and dependencies. By running a single command, you’ll get a boilerplate setup for a React backend app, ready to use with tools like ExpressJS,Cors,jwt,cookie-parser,mongoDB,dotenv and mongoose.

Features

  • Automatically creates a standard React project file structure.
  • Generates common files like index.js, .env,.gitignore and vercel.json.
  • Installs additional dependencies like express,cors,jwt,cookie-parser,dotenv,mongoDB and mongoose.
  • Saves you time by handling initial project setup and structure creation.

Created Files

  • index.js: The entry point for the React backend app.
  • .gitignore: Includes common files and folders to ignore in Git.
  • .env: Includes files to ignore visible for users.
  • vercel.json: Includes files for deploying on vercel.

Prerequisites

Before using this package, make sure you have:

  • Node.js (v14 or later) and npm installed on your system.

Installation

To use react-structure-package-backend(respa-back), you don’t need to install it globally. Instead, use npx to run it directly:

npx @mhmurad/respa-back init

This command will execute the init.js script in the package, setting up the project file structure and installing necessary dependencies.

Usage

  1. Run the Initialization Command

    To set up the React backend project structure, simply run:
npx @mhmurad/respa-back init
  1. What Happens During Initialization

    When you run the command:

A folder structure will be created in your current directory. Essential files like index.js and .env will be generated with starter content. express,cors,jwt,cookie-parser,dotenv,mongoDB and mongoose will be installed automatically, appearing in your package.json as dependencies.

  1. Start Using the Project

    Once the structure is created, navigate to your project folder and file (if needed) and install any remaining dependencies (e.g., enpress and mongodb) if they aren't installed by default.

If you have the structure and dependencies already in place, you can just start coding in the index.js file.

Additional Dependencies

If you need to install additional dependencies, you can add them using npm install as usual. This package sets up the initial folder structure and installs a couple of common dependencies, but you’re free to add more as needed.

Troubleshooting

Common Issues

  1. Permission Issues: If you run into permission issues, try using sudo with npx (on macOS or Linux) or run your terminal as Administrator (on Windows).

  2. Missing Dependencies: If express and mongodb are not installed by default, you can install them manually:

npm install express mongodb

Contact

If you run into any issues or have suggestions for improvement, feel free to open an issue on the GitHub repository or contact the maintainer.

License

This package is open-source and available under the ISC License. See the LICENSE file for more details.

NPM-Package-respa-back