Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/miladjoodi/zustand_starter_project

This is a starter template built with 𝐍𝐞𝐱𝐭.𝐣𝐬 and 𝐙𝐮𝐬𝐭𝐚𝐧𝐝. Perfect for beginners to learn basic state management in a clean and simple! 🚀
https://github.com/miladjoodi/zustand_starter_project

nextjs nextjs14 reactjs state-management tailwindcss typescript zustand zustand-persist zustand-state-management zustandjs

Last synced: 25 days ago
JSON representation

This is a starter template built with 𝐍𝐞𝐱𝐭.𝐣𝐬 and 𝐙𝐮𝐬𝐭𝐚𝐧𝐝. Perfect for beginners to learn basic state management in a clean and simple! 🚀

Awesome Lists containing this project

README

        

# Zustand Starter Project

This is a simple starter project built with **Next.js 14.2** and **Zustand**. It provides a foundational setup to help you quickly get started with state management in Next.js applications.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otcldhhriyjpsbsciax0.png)

## Features

- **State Management**: Uses [Zustand](https://github.com/pmndrs/zustand) for lightweight and scalable state management.
- **Local Storage Persistence**: Includes the capability to persist state to `localStorage`.
- **Multiple Branches**:
- `main`: Basic Zustand implementation.
- `persist`: Zustand with localStorage persistence.

## Installation

1. Clone the repository:

```bash
git clone https://github.com/MiladJoodi/Zustand_Starter_Project.git
```

2. Navigate to the project directory:

```bash
cd Zustand_Starter_Project
```

3. Install dependencies:

```bash
npm install
```

4. Run the development server:

```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) in your browser to see the app.

## Branches

### Main Branch
The main branch contains a basic implementation of Zustand to manage state efficiently in a Next.js environment.

### Persist Branch
The `persist` branch adds functionality to persist state in `localStorage`, ensuring that your state remains intact even after a page refresh.

To switch to the `persist` branch, run the following command:

```bash
git checkout persist
```

## Contribution
Feel free to open issues or submit pull requests for any improvements or suggestions. Contributions are always welcome!

## Repository
Check out the project on GitHub:
[Zustand Starter Project](https://github.com/MiladJoodi/Zustand_Starter_Project)

---

Happy coding! 🚀