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

v2.1.3

Published

A package to create a React front-end project structure

Downloads

250

Readme

React-Structure-Package-FrontEnd

  • Before you start create this first:
npm create vite@latest name-of-your-project -- --template react
# follow prompts
cd your-new-project-directory

-And then run this:

npx @mhmurad/respa init

Hints: This may take 3-7 minutes depends on your net speed.

react-structure-package(respa) is a Node.js package that helps you quickly set up a React front-end project structure with essential folders, files, and dependencies. By running a single command, you’ll get a boilerplate setup for a React app, ready to use with tools like React, React-dom, React-router-dom, React-icons, Axios, Firebase, Tailwind, DaisyUI, Prop-types, localforage, match-sorter, sort-by and React Hook Form.

Features

  • Automatically creates a standard React project folder structure.
  • Generates common files like index.css, ErrorPage.jsx, firebase.config.js,MainLayout.jsx,Routes.jsx,tailwind.config.js and Home.jsx.
  • Installs additional dependencies like React, React-dom, React-router-dom, React-icons, Axios, Firebase, Tailwind, DaisyUI, Prop-types, localforage, match-sorter, sort-by and React Hook Form.
  • Saves you time by handling initial project setup and structure creation.

Folder Structure Created

When you run this package, it creates the following folder structure:

'src',
    'src/components',
    'src/assets',
    'src/pages',
    'src/utils',
    'src/hooks',
    'src/layouts',
    'src/routes',
    'src/firebase',
    'src/provider',
    'public'

Created Files

  • src/main.jsx: A basic React component that serves as the app’s main component.
  • src/index.css: CSS file for global styles.
  • index.html: HTML file that serves as the main template.
  • src/components/ExampleComponent.js: A sample component to show where components can be added.
  • .gitignore: Includes common files and folders to ignore in Git.
  • And many more like: index.css, ErrorPage.jsx, firebase.config.js,MainLayout.jsx,Routes.jsx and Home.jsx

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(respa), you don’t need to install it globally. Instead, use npx to run it directly:

npx @mhmurad/respa init

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

Usage

  1. Run the Initialization Command

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

    When you run the command:

A folder structure will be created in your current directory. Essential files like App.js and index.html will be generated with starter content. react-router-dom and react-hook-form 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 (if needed) and install any remaining dependencies (e.g., react and react-dom) if they aren't installed by default.

To start the development server, initialize a new project with Create React App:

npx create-react-app

Or, if you have the structure and dependencies already in place, you can just start coding in the src folder.

  1. Example Usage in Code

    You can now start using react-router-dom and react-hook-form in your app right away. Here’s a quick example of how to use React Router in App.js:
// src/App.js
import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import ExampleComponent from "./components/ExampleComponent";

function App() {
  return (
    <Router>
      <div className="App">
        <h1>My React App</h1>
        <Routes>
          <Route path="/" element={<ExampleComponent />} />
        </Routes>
      </div>
    </Router>
  );
}

export default App;

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 react and react-dom are not installed by default, you can install them manually:

npm install react react-dom

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 MIT License. See the LICENSE file for more details.

NPM-Package-respa