Skip to content

Commit 02864df

Browse files
committed
update readme
1 parent 42abc92 commit 02864df

File tree

1 file changed

+67
-87
lines changed

1 file changed

+67
-87
lines changed

README.md

+67-87
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,120 @@
1-
# Vue.js Starter Template
1+
# Vue 3 SQLite Playground
22

3-
A modern Vue.js starter template with TypeScript, Pinia, Vue Router, TailwindCSS, and comprehensive testing setup. This template provides a robust foundation for building scalable Vue.js applications using the latest best practices.
3+
A modern Vue.js application demonstrating how to use SQLite in the browser through WebAssembly. This project showcases building offline-capable applications with a real SQL database running entirely in the browser.
44

55
## Features
66

7+
- 🗄️ Full SQLite database in the browser via WebAssembly
78
- 🚀 [Vue 3.5](https://vuejs.org/) with Composition API
8-
- ⚡️ [Vite 5](https://vitejs.dev/) for fast development and building
9+
- ⚡️ [Vite 5](https://vitejs.dev/) for development
910
- 🎯 [TypeScript 5.6](https://www.typescriptlang.org/) for type safety
10-
- 📦 [Pinia](https://pinia.vuejs.org/) for state management
11-
- 🛣️ [Vue Router](https://router.vuejs.org/) with automatic route generation
12-
- 🎨 [TailwindCSS 3](https://tailwindcss.com/) for utility-first styling
13-
- ✅ Testing Setup:
14-
- [Vitest](https://vitest.dev/) for unit testing
15-
- [Playwright](https://playwright.dev/) for end-to-end testing
16-
- 📝 [ESLint](https://eslint.org/) with [@antfu/eslint-config](https://github.com/antfu/eslint-config)
17-
- 🔧 Vue DevTools integration
11+
- 💾 Persistent storage using Origin Private File System (OPFS)
12+
- 🧵 Background processing with Web Workers
13+
- 🎨 [TailwindCSS 3](https://tailwindcss.com/) for styling
14+
15+
## Key Technologies
16+
17+
- **SQLite Wasm**: SQLite compiled to WebAssembly for browser execution
18+
- **Web Workers**: Background thread for database operations
19+
- **OPFS**: Persistent storage for database files
20+
- **@sqlite.org/sqlite-wasm**: Official SQLite WebAssembly package
1821

1922
## Prerequisites
2023

21-
- Node.js (version 20.x or higher recommended)
24+
- Node.js (version 20.x or higher)
25+
- Modern browser with WebAssembly and OPFS support
2226
- npm (comes with Node.js)
2327

2428
## Getting Started
2529

26-
1. Use this template by clicking the "Use this template" button above
27-
2. Clone your new repository:
28-
30+
1. Clone the repository:
2931
```bash
30-
git clone https://github.com/your-username/your-repo-name.git
31-
cd your-repo-name
32+
git clone https://github.com/your-username/vue-sqlite-playground.git
33+
cd vue-sqlite-playground
3234
```
3335

34-
3. Install dependencies:
35-
36+
2. Install dependencies:
3637
```bash
3738
npm install
3839
```
3940

40-
4. Start the development server:
41-
41+
3. Start the development server:
4242
```bash
4343
npm run dev
4444
```
4545

46-
5. Open your browser and visit `http://localhost:5173`
47-
48-
## Available Scripts
49-
50-
- `npm run dev` - Start development server
51-
- `npm run build` - Build for production
52-
- `npm run preview` - Preview production build
53-
- `npm run lint` - Lint and fix files
54-
- `npm run test:unit` - Run unit tests
55-
- `npm run test:e2e` - Run end-to-end tests
56-
- `npm run type-check` - Check TypeScript types
46+
4. Open your browser and visit `http://localhost:5173`
5747

5848
## Project Structure
5949

6050
```
61-
├── .github/ # GitHub configuration files
62-
├── e2e/ # End-to-end tests
63-
├── public/ # Public static assets
6451
├── src/
65-
│ ├── assets/ # Project assets
66-
│ ├── components/ # Vue components
67-
│ ├── composables/ # Composable functions
68-
│ ├── layouts/ # Layout components
69-
│ ├── pages/ # Route pages
70-
│ ├── stores/ # Pinia stores
71-
│ ├── App.vue # Root component
72-
│ └── main.ts # Application entry point
73-
├── test/ # Test utilities and setup
74-
└── vite.config.ts # Vite configuration
52+
│ ├── components/ # Vue components
53+
│ ├── composables/ # SQLite-related composables
54+
│ ├── config/ # Database configuration
55+
│ ├── services/ # SQLite service layer
56+
│ ├── repositories/ # Data access layer
57+
│ ├── types/ # TypeScript definitions
58+
│ └── utils/ # Helper utilities
7559
```
7660

77-
## TypeScript Support
78-
79-
This template is fully typed with TypeScript. Configuration files can be found in:
80-
81-
- `tsconfig.json`
82-
- `tsconfig.node.json`
83-
- `tsconfig.app.json`
61+
## Features Demo
8462

85-
## Testing
63+
- Create and manage SQLite databases in the browser
64+
- Execute SQL queries directly in the UI
65+
- View query results in real-time
66+
- Persistent storage across browser sessions
67+
- Example CRUD operations
8668

87-
### Unit Tests
88-
89-
Unit tests are powered by Vitest. Run them with:
90-
91-
```bash
92-
npm run test:unit
93-
```
94-
95-
### E2E Tests
96-
97-
End-to-end tests use Playwright. Run them with:
69+
## Available Scripts
9870

99-
```bash
100-
npm run test:e2e
101-
```
71+
- `npm run dev` - Start development server
72+
- `npm run build` - Build for production
73+
- `npm run preview` - Preview production build
74+
- `npm run lint` - Lint and fix files
75+
- `npm run type-check` - Check TypeScript types
10276

103-
## ESLint Configuration
77+
## Browser Support
10478

105-
This template uses [@antfu/eslint-config](https://github.com/antfu/eslint-config) for consistent code style. Customize the rules in `.eslintrc` if needed.
79+
This application requires a modern browser with support for:
80+
- WebAssembly
81+
- Web Workers
82+
- Origin Private File System (OPFS)
83+
- SharedArrayBuffer
10684

107-
## Customization
85+
## Technical Details
10886

109-
### TailwindCSS
87+
### Database Configuration
11088

111-
Customize your TailwindCSS configuration in `tailwind.config.js`:
89+
The SQLite database is configured with a sample table structure:
11290

113-
```js
114-
/** @type {import('tailwindcss').Config} */
115-
module.exports = {
116-
content: ['./src/**/*.{vue,js,ts}'],
117-
theme: {
118-
extend: {
119-
// Add your customizations here
120-
},
121-
},
122-
plugins: [],
123-
}
91+
```sql
92+
CREATE TABLE IF NOT EXISTS test_table (
93+
id INTEGER PRIMARY KEY AUTOINCREMENT,
94+
name TEXT NOT NULL,
95+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
96+
);
12497
```
12598

126-
### Vite Configuration
99+
### Architecture
127100

128-
Modify the Vite configuration in `vite.config.ts` to add plugins or adjust build settings.
101+
The application uses a layered architecture:
102+
- Service Layer: Handles SQLite initialization and core operations
103+
- Repository Layer: Provides data access methods
104+
- Composables: Vue-specific database interaction hooks
129105

130106
## Contributing
131107

132108
1. Fork the repository
133-
2. Create a new branch: `git checkout -b feature/your-feature`
134-
3. Commit your changes: `git commit -m 'Add some feature'`
109+
2. Create a feature branch: `git checkout -b feature/your-feature`
110+
3. Commit changes: `git commit -m 'Add some feature'`
135111
4. Push to the branch: `git push origin feature/your-feature`
136112
5. Submit a pull request
137113

138114
## License
139115

140116
[MIT](./LICENSE)
117+
118+
## Learn More
119+
120+
For a detailed explanation of how this works, check out our [blog post](https://your-blog-post-url) about implementing SQLite in Vue 3 applications.

0 commit comments

Comments
 (0)