Welcome to React-started, a React project template designed to speed up the start-up of your web applications. This template features a robust initial configuration, modern development tools and a well-organized folder structure for easy project development and maintenance.
- React Started Project
React Starter Project is a comprehensive boilerplate crafted to accelerate the development of modern React applications. It seamlessly integrates TypeScript for robust typing, Vite for blazing-fast builds, TailwindCSS for utility-first styling, and Zustand for lightweight state management. With preconfigured tools like ESLint and Prettier for code quality and formatting, this starter kit empowers developers to focus on building scalable, maintainable, and performant web applications without worrying about setup complexities.
- TypeScript: Ensures type safety, improves code quality through static type checking, and reduces runtime errors.
- Vite: A fast and efficient build tool that offers hot module replacement (HMR) for a seamless development experience.
- TailwindCSS: A utility-first CSS framework for rapid and responsive UI development with a focus on customization.
- Zustand: A lightweight and scalable state management solution that integrates seamlessly with React.
- React Router: Declarative routing for building single-page applications with ease.
- Custom Hooks: Reusable hooks for data fetching, theme management, and toast notifications to enhance productivity.
- SEO Optimization: Built-in support for SEO using the
react-helmet-async
library. - ESLint & Prettier: Ensures clean and consistent code with automatic linting and formatting.
- Docker: Includes configurations for containerizing the application, making it portable and scalable.
- Nginx: Provides production-ready configurations for deploying the application with Nginx.
This project utilizes the following technologies:
- React: A JavaScript library for building user interfaces.
- TypeScript: A superset of JavaScript that adds static types.
- Vite: A modern frontend build tool.
- TailwindCSS: A utility-first CSS framework.
- Zustand: A small, fast state management library.
- Axios: A promise-based HTTP client for making requests.
- React Router: A library for routing in React applications.
- react-helmet-async: A library for managing changes to the document head.
The project is organized into a clear and logical directory structure, facilitating easy navigation and maintenance:
React-started/
βββ .github/ # Configurations GitHub (workflows, actions)
βββ .husky/ # Hooks Git
βββ nginx-config/ # Configurations Nginx pour la production
βββ public/ # Fichiers statiques publics
βββ src/ # Code source de l'application
β βββ assets/ # Ressources (images, styles, etc.)
β βββ components/ # Composants React rΓ©utilisables
β βββ pages/ # Pages de l'application
β βββ App.tsx # Composant principal de l'application
β βββ main.tsx # Point d'entrΓ©e de l'application
βββ .dockerignore # Fichiers Γ ignorer par Docker
βββ .env.example # Exemple de fichier d'environnement
βββ .eslintrc.js # Configuration ESLint
βββ .gitignore # Fichiers Γ ignorer par Git
βββ .prettierrc # Configuration Prettier
βββ docker-compose.yml # Configuration Docker Compose
βββ Dockerfile # Dockerfile pour la crΓ©ation de l'image
βββ package.json # DΓ©pendances et scripts npm
βββ tailwind.config.js # Configuration Tailwind CSS
βββ tsconfig.json # Configuration TypeScript
βββ vite.config.ts # Configuration Vite
Before you start, make sure you have the following items installed on your machine:
- Node.js: Javascript runtine (
>=v20.18.
) - Yarn: Package management (
>=1.22.22
) - npm: Package management (
>=10.8.2
) - Docker: For containerization (optional)
To run this project, you need to configure all the environment variables listed in the .env.example file.
Make sure to copy and rename the .env.example
file to .env
, then update the values as required for your setup.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/01Barthez/React-started.git cd react-started
-
Install dependencies:
yarn install
-
Start the development server:
yarn dev
Once the development server is running, you can access the application at http://localhost:4000. You can navigate through the different routes defined in the router.tsx
file.
To deploy the application using Docker, follow these steps:
-
Building the Docker image:
yarn docker:build
-
Run the container:
yarn docker:start
The application will be available at http://localhost:4001.
Here is a list of important scripts available in this project and their purposes:
dev
: Starts the development server using Vite.start
: Previews the production build locally.docker:start
: Previews the container app.
build
: Cleans thedist
folder and builds the application for production.build:test
: Builds the application in production mode, outputting to a temporary directory.docker:build"
: Builds the container application.
test
: Runs all unit tests once using Vitest.test:watch
: Runs tests in watch mode for continuous feedback.test:coverage
: Generates a code coverage report for the tests.test:preview
: Serves the coverage report locally on port4003
.test:clean
: Cleans the coverage directory.
lint
: Lints the codebase with ESLint and fixes issues automatically.format
: Formats the codebase with Prettier.
docs
: Generates project documentation using TypeDoc.docs:preview
: Serves the generated documentation locally on port4002
.docs:clean
: Cleans the documentation directory.
release
: Creates a patch release withstandard-version
.release:minor
: Creates a minor release.release:major
: Creates a major release.
clean
: Removes thedist
folder.reinstall
: Cleans dependencies, cache, and reinstalls packages.upgrade
: Opens an interactive upgrade interface for dependencies.
ci
: Runs linting, tests, and builds the project in sequence.
prepare
: Installs Husky for managing Git hooks.prepare:pre-commit
: Sets up a pre-commit hook to run linting before commits.
This list covers the key scripts to help you understand and use them effectively in your workflow.
useFetch
: A custom hook for fetching data from APIs.useToast
: A custom hook for managing toast notifications.useTheme
: A custom hook for managing theme preferences.
Contributions are always welcome!
See contributing
for ways to get started.
Please adhere to this project's Code of Conduct
.
This project is licensed under the MIT License