https://github.com/5h1ngy/bl-vitejs-javascript-react
A modern web application built with React, JavaScript, and Vite. Perfect for creating responsive, interactive, and high-performance web applications with a component-based architecture.
https://github.com/5h1ngy/bl-vitejs-javascript-react
component-based javascript local-storage offline-first react responsive spa vite web-app
Last synced: 6 months ago
JSON representation
A modern web application built with React, JavaScript, and Vite. Perfect for creating responsive, interactive, and high-performance web applications with a component-based architecture.
- Host: GitHub
- URL: https://github.com/5h1ngy/bl-vitejs-javascript-react
- Owner: 5h1ngy
- Created: 2025-04-01T02:44:11.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T03:13:28.000Z (6 months ago)
- Last Synced: 2025-04-01T04:21:46.203Z (6 months ago)
- Topics: component-based, javascript, local-storage, offline-first, react, responsive, spa, vite, web-app
- Language: JavaScript
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ React + JavaScript + Vite




A modern web application built with React, JavaScript, and Vite. Perfect for creating responsive, interactive, and high-performance web applications with a component-based architecture.
**Topics:** `react` `javascript` `vite` `web-app` `spa` `offline-first` `local-storage` `component-based` `responsive`
## ๐ 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
- ๐ 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
- ๐ JavaScript linting with ESLint
- ๐จ Code formatting with Prettier
- ๐งช Testing with Vitest and React Testing Library## ๐๏ธ Project Structure
```
bl-vitejs-javascript-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.jsx # Root React component
โ โโโ main.jsx # Application entry point
โ โโโ index.css # Global styles
โโโ .eslintrc.cjs # ESLint configuration
โโโ vite.config.js # 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:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
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',
'react/prop-types': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
}
```## ๐ Resources
- [React Documentation](https://reactjs.org/docs/getting-started.html)
- [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)