React Prime React Prime Save Abandoned

A starter kit to create comprehensive React apps with React-Query and Styled-Components.

Project README

prime-logo

React Prime

Build Status GitHub release


Quick start

Use create-react-prime for easy install.

npx create-react-prime my-app
cd my-app
npm start

Features

NPM Scripts

  • Start develop server: $ npm start
  • Create production build: $ npm run build
  • Start server: $ npm run server
  • Remove build folder: $ npm run clean
  • Run ESLint: $ npm run lint
  • Run webpack-bundle-analyzer: $ npm run analyzer

Deployment

Make sure all modules are installed: $ npm install

Create a build for production, this will add a /dist folder to the root with all bundles. $ npm run build

Run the server file to start server: $ npm run server

For production we recommend to use PM2 to run the server with advanced process management.

Development Workflow

Components

The components are separated in common, modules and pages.

  • The common folder includes components are self-contained and can be used through the entire app
  • The modules are bundled components which depend on each other.
  • The pages folder contain top level pages of the application

Queries

To manage data throughout the while application this boilerplate makes use of React Query. A simple query is similar to the following code snippet:

export const useGetItems = () => {
  return useQuery<ServerResponse, Error, ReselectedData>(
    'items', // either a string, or an array
    async () => await api.get({ path: '/users' }),
    {
      select: (response) => {
        // format or select parts of the response
        return response;
      }
    },
  );
};
Open Source Agenda is not affiliated with "React Prime React Prime" Project. README Source: react-prime/react-prime

Open Source Agenda Badge

Open Source Agenda Rating