@searpro/create-react v0.0.3-alpha
React + Redux-toolkit + TypeScript + Vite - Starter kit š„
This is a customized version of the official Vite react-ts preset
FEATURES
ā Zero configuration redux application state.
ā Configuration management for different environments
ā HTTP helper with customized fetcher function with Axios.
ā Ready to use application router with react-router-dom
ā Sample code for pages and components.
ā Some vscode plugin recommendations for ESLint and prettier.
ā Pre-commit hooks for linting.
ā Pre-configured cypress test suite.
ā Working example of a component utilizing REST API with http helper and redux store.
š And few other goodies.
Pre-requisites
nodejs >=18.18.0
vscode [recommended]
Getting started
$ npx @searpro/create-react <your-app-name>
.....
.....
$ cd <your-app-name> && npm run dev
Running the application
DEVELOPMENT
$ npm run dev
BUILD
$ npm run build
LINT
$ npm run lint
$ npm run lint:fix #to fix lint errors
TEST
$ npm test
Application Structure
react-vite-redux-starter [folder structure]
āāā index.html
āāā public
ā āāā [assets to be kept in public]
āāā cypress
ā āāā [cypress test specs]
āāā src
āāā global.d.ts [global types]
āāā store
ā āāā [redux store related files]
āāā config
ā āāā environments
ā ā āāā [env-specific configurations. dev/qa/stg/prod etc]
ā āāā endpoints.ts [api endpoints/paths with http method]
ā āāā index.ts [configuration entry point]
āāā hooks
ā āāā [react custom hooks]
āāā pages
ā āāā [Main pages/container components]
ā āāā Users
ā ā āāā Users.tsx
ā ā āāā [css and other assets can also be added]
ā āāā Home
ā āāā Home.tsx
āāā components
āāā [Re-usable components]
āāā Button
ā āāā Button.tsx
ā āāā [assets/css etc can go here]
āāā Header
ā āāā Header.tsx
āāā Footer
āāā Footer.tsx
FURTHER READING..
For customizing Vite build, check out https://vitejs.dev/guide/
For more information on Redux-Toolkit: https://redux-toolkit.js.org/usage/usage-with-typescript
For more information on Cypress: https://docs.cypress.io/guides/component-testing/overview
For customizing Axios: https://axios-http.com/docs/req_config
ā
2 years ago
2 years ago