92 lines
2.6 KiB
Markdown
92 lines
2.6 KiB
Markdown
# Noteplace Frontend - Design & Implementation Plan
|
|
|
|
This document outlines the design, architecture, and implementation plan for the Noteplace Progressive Web Application (PWA) frontend.
|
|
|
|
## Getting Started
|
|
|
|
1. **Install Dependencies**
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
2. **Configure Environment**
|
|
Create a `.env` file in the root of the project and add the following line:
|
|
```
|
|
VITE_API_BASE_URL=http://localhost:3001
|
|
```
|
|
|
|
3. **Run the Development Server**
|
|
```bash
|
|
npm run dev
|
|
```
|
|
The application will be available at `http://localhost:5173`.
|
|
|
|
## Environment Variables
|
|
|
|
* `VITE_API_BASE_URL`: The base URL for the Noteplace backend API.
|
|
|
|
---
|
|
|
|
## 1. Overview
|
|
|
|
Noteplace is a PWA primarily targeting iOS/iPhone, with support for Desktop and Android web. It allows authenticated users to rate places against specific attributes (e.g., "Service," "Cleanliness," or even a specific menu item).
|
|
|
|
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
|
|
```js
|
|
export default defineConfig([
|
|
globalIgnores(['dist']),
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
extends: [
|
|
// Other configs...
|
|
|
|
// Remove tseslint.configs.recommended and replace with this
|
|
tseslint.configs.recommendedTypeChecked,
|
|
// Alternatively, use this for stricter rules
|
|
tseslint.configs.strictTypeChecked,
|
|
// Optionally, add this for stylistic rules
|
|
tseslint.configs.stylisticTypeChecked,
|
|
|
|
// Other configs...
|
|
],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
// other options...
|
|
},
|
|
},
|
|
])
|
|
```
|
|
|
|
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
|
|
```js
|
|
// eslint.config.js
|
|
import reactX from 'eslint-plugin-react-x'
|
|
import reactDom from 'eslint-plugin-react-dom'
|
|
|
|
export default defineConfig([
|
|
globalIgnores(['dist']),
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
extends: [
|
|
// Other configs...
|
|
// Enable lint rules for React
|
|
reactX.configs['recommended-typescript'],
|
|
// Enable lint rules for React DOM
|
|
reactDom.configs.recommended,
|
|
],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
// other options...
|
|
},
|
|
},
|
|
])
|
|
```
|