https://github.com/5h1ngy/bl-vitejs-typescript-react
A modern web application built with React, TypeScript, and Vite. Perfect for creating type-safe, component-based web applications with high performance and exceptional developer experience.
https://github.com/5h1ngy/bl-vitejs-typescript-react
component-based local-storage offline-first react spa type-safety typescript vite web-app
Last synced: 7 months ago
JSON representation
A modern web application built with React, TypeScript, and Vite. Perfect for creating type-safe, component-based web applications with high performance and exceptional developer experience.
- Host: GitHub
- URL: https://github.com/5h1ngy/bl-vitejs-typescript-react
- Owner: 5h1ngy
- Created: 2025-04-01T02:44:37.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T03:17:24.000Z (7 months ago)
- Last Synced: 2025-04-01T04:21:47.964Z (7 months ago)
- Topics: component-based, local-storage, offline-first, react, spa, type-safety, typescript, vite, web-app
- Language: CSS
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ React + TypeScript + Vite




A modern web application built with React, TypeScript, and Vite. Perfect for creating type-safe, component-based web applications with high performance and exceptional developer experience.
**Topics:** `react` `typescript` `vite` `web-app` `spa` `offline-first` `local-storage` `component-based` `type-safety`
## ๐ Table of Contents
- [Features](#-features)
- [Project Structure](#-project-structure)
- [Recommended IDE Setup](#-recommended-ide-setup)
- [Project Setup](#-project-setup)
- [Package Managers](#-package-managers)
- [ESLint Configuration](#-eslint-configuration)
- [Resources](#-resources)## โจ Features
- โ๏ธ React framework for UI components
- ๐ Type safety with TypeScript
- ๐ Support for dashboard and statistical visualizations
- ๐๏ธ Ability to implement timeline and calendar views
- ๐พ Data storage in localStorage (100% offline)
- ๐ค Import/export and backup functionality
- ๐ Hot Module Replacement (HMR) during development
- โก Ultra-fast build with Vite bundler
- ๐จ Component-based architecture
- ๐ฑ Responsive design for all devices
- ๐งฉ Modular code structure
- ๐ TypeScript linting with ESLint
- ๐จ Code formatting with Prettier
- ๐งช Testing with Vitest and React Testing Library
- ๐๏ธ Support for transient props pattern in styled components## ๐๏ธ Project Structure
```
bl-vitejs-typescript-react/
โโโ public/ # Static assets
โโโ dist/ # Build output directory
โโโ src/
โ โโโ assets/ # Project assets (images, fonts, etc.)
โ โโโ components/ # React components
โ โ โโโ ui/ # UI components
โ โ โโโ layout/ # Layout components
โ โโโ hooks/ # Custom React hooks
โ โโโ utils/ # Utility functions
โ โโโ context/ # React context providers
โ โโโ App.tsx # Root React component
โ โโโ main.tsx # Application entry point
โ โโโ index.css # Global styles
โโโ .eslintrc.cjs # ESLint configuration
โโโ tsconfig.json # TypeScript configuration
โโโ tsconfig.node.json # TypeScript configuration for Node
โโโ vite.config.ts # Vite configuration
โโโ package.json # Project dependencies and scripts
โโโ index.html # HTML template
```## ๐ ๏ธ Recommended IDE Setup
- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
## ๐ Project Setup
### ๐ฅ Install
```bash
$ pnpm install
```### ๐ง Development
```bash
$ pnpm dev
```### ๐ฆ Build
```bash
$ pnpm build
```### ๐งช Test
```bash
$ pnpm test
```## ๐ฆ Package Managers
This project supports multiple package managers. Here's how to use each one:
### NPM
NPM is the default package manager for Node.js.
**Install NPM:**
```bash
# Included with Node.js installation
```**Setup project with NPM:**
```bash
# Install dependencies
$ npm install# Run development server
$ npm run dev# Build application
$ npm run build# Run tests
$ npm run test
```**Key features:**
- ๐ Vast package ecosystem
- ๐ Hierarchical node_modules structure
- ๐ Package.json for dependency management### Yarn
Yarn is a fast, reliable, and secure alternative to NPM.
**Install Yarn:**
```bash
# Install using NPM
$ npm install -g yarn
```**Setup project with Yarn:**
```bash
# Install dependencies
$ yarn# Run development server
$ yarn dev# Build application
$ yarn build# Run tests
$ yarn test
```**Key features:**
- โก Faster installation speeds
- ๐ฆ Offline caching
- ๐ Better security with checksums
- ๐ yarn.lock for deterministic installations### PNPM
PNPM is a disk-space efficient package manager.
**Install PNPM:**
```bash
# Install using NPM
$ npm install -g pnpm
```**Setup project with PNPM:**
```bash
# Install dependencies
$ pnpm install# Run development server
$ pnpm dev# Build application
$ pnpm build# Run tests
$ pnpm test
```**Key features:**
- ๐พ Disk space savings through symlinks
- ๐ Fast installation speeds
- ๐ Content-addressable storage
- ๐ pnpm-lock.yaml for dependency lock### Comparison
| Feature | NPM | Yarn | PNPM |
|-----------------------|---------|---------|---------|
| Disk usage | High | High | Low |
| Installation speed | Slow | Fast | Fastest |
| Parallel installations| Limited | Yes | Yes |
| Workspace support | Limited | Good | Best |
| Offline mode | Limited | Good | Good |
| Security | Good | Better | Better |## ๐ก๏ธ ESLint Configuration
This project uses ESLint to ensure code quality. The configuration is located in `.eslintrc.cjs`.
### Basic Configuration
```js
// .eslintrc.cjs
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
```### For Production Applications
For production applications, you may want to add additional rules:
```js
// Additional rules for production
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
}
```## ๐ Resources
- [React Documentation](https://reactjs.org/docs/getting-started.html)
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
- [Vite Documentation](https://vitejs.dev/guide/)
- [ESLint Documentation](https://eslint.org/docs/user-guide/getting-started)
- [NPM Documentation](https://docs.npmjs.com/)
- [Yarn Documentation](https://yarnpkg.com/getting-started)
- [PNPM Documentation](https://pnpm.io/motivation)