Client
-
Demo
React Router
with routes:/
- Home page./contact
- Contact page./auth/login
- Login page./auth/register
- Register page.
-
Demo
Redux Toolkit
with Pokemon index "counter":⏫
- Increment index.⏬
- Decrement index.🔄
- Reset index.
-
Demo
TanStack Query
with Poké API:- Prefetch data (10 Pokemon per page).
- Search Pokemon.
-
Demo
React Hook Form
with a fake login form. -
Demo
React
with two custom hooks:useDebounce
- Debounce user input in search bar.useImageLoad
- Watch image loading state and detectsrc
changes.
-
Demo pre-commit hooks with
husky
andlint-staged
. And lint commit messages withcommitlint
. -
Override
Mantine
theme (fonts, colors,...) withWindiCSS
. -
UI components using
Mantine
. -
Icons using
Iconify
. -
Styling using
WindiCSS
.
Color | Hex |
---|---|
Primary Color | #2563EB |
This project uses Yarn as package manager:
npm install --global yarn
Clone the project:
git clone https://github.com/DuckyMomo20012/react-template-demo.git
Go to the project directory:
cd react-template-demo
Install dependencies:
yarn
Start the server:
yarn dev
The Poké API will provide 1154
pokemon.
Using buttons to increment, decrement, and reset the Pokemon index "counter",
start from 0
:
⏫
- Increment index.⏬
- Decrement index.🔄
- Reset index.
When searching for a Pokemon, the counter will skip to the id (NO. ) of the Pokemon, which may exceed the total number of Pokemon. When exceeding:
⏫
- Reset counter (skip to 0).⏬
- Skip to Pokemon with index 1153.
Login page:
-
You can log in with this fake account:
- email:
example@gmail.com
. - password:
1234
.
- email:
-
It will just show a message when you log in successfully, and navigate back to Home page.
Register page:
- It will do nothing when you submit the form.
Folder architecture:
From my react-template Wiki, Folder Architecture page:
.
├── components
│ ├── elements
│ ├── layouts
│ └── modules
├── constants
├── context
├── hooks
├── pages
│ └── api
├── routes
├── store
│ └── slice
└── main.jsx
elements
: Basic building blocks.layouts
: Wrap your pages with the default layout.modules
: Modules are built from multipleelements
.constants
: Global constants.context
: React Context providers.hooks
: Custom hooks.pages
: Your page routes (adopt from NextJS folder architecture).pages/api
: Your APIs (adopt from NextJS folder architecture).routes
: Global route for react-router.store
: Store your Redux store.store/slice
: Store your Redux slices.
- TypeScript support.
- Show more Pokemon details.
- Infinite scroll.
Contributions are always welcome!
Please read the Code of Conduct.
-
Is this project still maintained?
- Yes, but I will only update UI, docs, or dependencies. New features won't be added frequently.
-
Is this project fully typed?
- No, but I will add TypeScript support in the future.
Distributed under MIT license. See LICENSE for more information.
Duong Vinh - @duckymomo20012 - tienvinh.duong4@gmail.com
Project Link: https://github.com/DuckyMomo20012/react-template-demo.
Here are useful resources and libraries that we have used in our projects:
- Awesome Readme Template: A detailed template to bootstrap your README file quickly.