Giter VIP home page Giter VIP logo

ascii-16 / react-query-zustand-ts-vite-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
73.0 2.0 17.0 649 KB

A React boilerplate with Typescript using Vite. Includes React-query, Zustand, Tailwindcss, EsLint + Prettier, Husky Commit Lint, Jest with PWA support

Home Page: https://whimsical-sunflower-96e7fb.netlify.app/

License: MIT License

Shell 0.42% JavaScript 0.47% HTML 2.30% CSS 2.17% TypeScript 91.48% SCSS 3.16%
typescript reactjs react react-query zustand tailwindcss boilerplate eslint jest pwa

react-query-zustand-ts-vite-boilerplate's Introduction

React Query, Zustand, TypeScript & Vite Boilerplate

This is a template repository to set up a project using React, React Query, Zustand, TypeScript, and Vite, aiming to provide a scalable structure and essential configurations to kick-start your next application.

Stack

My Tech Stack

Tool Purpose
React A JavaScript library for building user interfaces
React Query Data synchronization library for React
Zustand Minimalist state management
TypeScript Static typing for JavaScript
Vite Build tool and development server

Features

✅ Faster build with Vite

✅ State management using Zustand

✅ Data fetching using React Query and Axios

✅ TypeScript for static typing

✅ Pre-configured with ESLint and Prettier for code linting and formatting

✅ Includes example components to get started quickly

Required Versions

Tool Version
NodeJS >=16
TypeScript >=4.9.4

Getting Started

Clone the repository

git clone https://github.com/vintagegnome/react-query-zustand-ts-vite-boilerplate.git
cd react-query-zustand-ts-vite-boilerplate

Installing Dependencies

npm install

Running Locally

To run the project locally, simply execute:

npm run dev

Scripts

Command Description
start Run build:css then watch TailwindCSS and Vite concurrently
watch:css Watch for changes in index.css and output to styles.css using TailwindCSS
build:css Build CSS using TailwindCSS from index.css to styles.css
build Run TypeScript compiler, build CSS and then Vite build
preview Run Vite preview
lint Lint TypeScript files using ESLint
lint:fix Fix linting issues in TypeScript files using ESLint
format Format .ts, .tsx, and .json files using Prettier
test Run Jest tests
release Run standard-version for versioning
commit Use git-cz for commits
prepare Set up Husky for git hooks in a production environment

Project Structure

Here's a basic overview of the significant folders in the boilerplate:

├── public
└── src
  ├── components
  ├── hooks
  ├── lib
  ├── pages
  ├── routes
  ├── services
  ├── store
  └── types
Folder Description
src/ Contains the main source code for the application.
components Reusable React components, each handling a specific piece of the UI.
hooks Custom React hooks that encapsulate logic and behaviors which can be reused across different components.
lib Miscellaneous utility functions, helpers, and other standalone pieces of logic.
pages Components representing full pages in the application, typically corresponding to routes.
routes Configuration and components related to routing in the application.
services Functions or classes that handle tasks like API calls, data processing, or other "service"-like tasks.
store Zustand st ores for state management, holding
public/ Contains static assets like images, fonts, and the entry HTML file. Assets in this directory are served directly and are not processed by bundlers like Vite.

Features

Tool/Library Description
React Query Helps in fetching, caching, and updating asynchronous data.
Zustand For simple and scalable state management.
TypeScript For type-safe code and scalability.
Vite For faster builds and a smoother developer experience.

Contribution

If you'd like to contribute to this boilerplate, feel free to fork and send a PR. All contributions are welcome!

License

MIT

react-query-zustand-ts-vite-boilerplate's People

Contributors

akhil-neoito avatar ascii-16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-query-zustand-ts-vite-boilerplate's Issues

Can not run the App because Cross-Origin Requests are Blocked

Hi, I like to check out this boilerplate but the API (https://newsdata.io) blocks Cross-Origin Requests

To Reproduce
Steps to reproduce the behavior:

  1. clone repo
  2. npm install
  3. run npm run start
  4. check browser console

Expected behavior
I like to see some working example :-)

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux Mint
  • Browser: Chrome, Firefox
  • Version 116, 117

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.