|
1 | | -# React + TypeScript + Vite |
2 | | - |
3 | | -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
4 | | - |
5 | | -Currently, two official plugins are available: |
6 | | - |
7 | | -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh |
8 | | -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
9 | | - |
10 | | -## Expanding the ESLint configuration |
11 | | - |
12 | | -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: |
13 | | - |
14 | | -```js |
15 | | -export default tseslint.config({ |
16 | | - extends: [ |
17 | | - // Remove ...tseslint.configs.recommended and replace with this |
18 | | - ...tseslint.configs.recommendedTypeChecked, |
19 | | - // Alternatively, use this for stricter rules |
20 | | - ...tseslint.configs.strictTypeChecked, |
21 | | - // Optionally, add this for stylistic rules |
22 | | - ...tseslint.configs.stylisticTypeChecked, |
23 | | - ], |
24 | | - languageOptions: { |
25 | | - // other options... |
26 | | - parserOptions: { |
27 | | - project: ['./tsconfig.node.json', './tsconfig.app.json'], |
28 | | - tsconfigRootDir: import.meta.dirname, |
29 | | - }, |
30 | | - }, |
31 | | -}); |
32 | | -``` |
| 1 | +# Lightnovel Crawler — Web |
| 2 | + |
| 3 | +[](https://github.com/lncrawl/lncrawl-web/actions/workflows/build.yml) |
| 4 | +[](https://deepwiki.com/lncrawl/lncrawl-web) |
| 5 | + |
| 6 | +Web UI for [**Lightnovel Crawler**](https://github.com/lncrawl/lightnovel-crawler): browse sources, queue crawl jobs, manage libraries, and read novels in the browser. Installable as a PWA for a native-like experience. |
| 7 | + |
| 8 | +## Prerequisites |
| 9 | + |
| 10 | +- **Node.js** (LTS) — use the version in [.nvmrc](.nvmrc) if you use nvm |
| 11 | +- **Yarn** |
| 12 | +- **API** — the backend must be running for the web app to work (see [Lightnovel Crawler](https://github.com/lncrawl/lightnovel-crawler)) |
| 13 | + |
| 14 | +## Getting started |
| 15 | + |
| 16 | +```bash |
| 17 | +# Install dependencies |
| 18 | +yarn install |
| 19 | + |
| 20 | +# Run development server (default: http://localhost:5173) |
| 21 | +yarn dev |
33 | 22 |
|
34 | | -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: |
35 | | - |
36 | | -```js |
37 | | -// eslint.config.js |
38 | | -import reactX from 'eslint-plugin-react-x'; |
39 | | -import reactDom from 'eslint-plugin-react-dom'; |
40 | | - |
41 | | -export default tseslint.config({ |
42 | | - plugins: { |
43 | | - // Add the react-x and react-dom plugins |
44 | | - 'react-x': reactX, |
45 | | - 'react-dom': reactDom, |
46 | | - }, |
47 | | - rules: { |
48 | | - // other rules... |
49 | | - // Enable its recommended typescript rules |
50 | | - ...reactX.configs['recommended-typescript'].rules, |
51 | | - ...reactDom.configs.recommended.rules, |
52 | | - }, |
53 | | -}); |
| 23 | +# Type-check and build for production |
| 24 | +yarn build |
| 25 | + |
| 26 | +# Run ESLint |
| 27 | +yarn lint |
54 | 28 | ``` |
| 29 | + |
| 30 | +Build output is written to **`dist/`** by default (see `vite.config.ts` for `outDir` and chunk splitting). |
| 31 | + |
| 32 | +## Configuration |
| 33 | + |
| 34 | +In development, the app talks to the API at **`http://localhost:8080`**. |
| 35 | +Start the backend there or adjust the base URL. |
| 36 | + |
| 37 | +API base URL is set in [src/config.ts](src/config.ts): |
| 38 | + |
| 39 | +- **Development** — `http://localhost:8080` |
| 40 | +- **Production** — empty string (same origin; serve the built app from the same host as the API) |
| 41 | + |
| 42 | +## Tech stack |
| 43 | + |
| 44 | +| Layer | Choice | |
| 45 | +| --------- | ---------------------------------------------- | |
| 46 | +| Runtime | Node.js (LTS) | |
| 47 | +| Framework | React 19 | |
| 48 | +| Build | Vite, TypeScript | |
| 49 | +| UI | Ant Design | |
| 50 | +| State | Redux Toolkit, Redux Persist | |
| 51 | +| Routing | React Router | |
| 52 | +| PWA | vite-plugin-pwa (auto-update, offline support) | |
| 53 | + |
| 54 | +## Project structure |
| 55 | + |
| 56 | +| Path | Purpose | |
| 57 | +| ----------------- | ---------------------------------------------------- | |
| 58 | +| `src/` | React app (entry, styles, types) | |
| 59 | +| `src/pages/` | Route-level pages and [router](src/pages/router.tsx) | |
| 60 | +| `src/components/` | Reusable UI, layout, reader, and shared components | |
| 61 | +| `src/store/` | Redux store and slices | |
| 62 | +| `src/utils/` | Helpers, theme, axios setup | |
| 63 | +| `src/config.ts` | API base URL and app config | |
| 64 | +| `vite.config.ts` | Vite config (PWA, build output, aliases) | |
| 65 | + |
| 66 | +## PWA |
| 67 | + |
| 68 | +The app is a Progressive Web App: |
| 69 | + |
| 70 | +- **Installable** — Add to home screen on supported browsers |
| 71 | +- **Auto-update** — New versions are applied when available (no manual refresh) |
| 72 | +- **Offline** — Cached assets for repeat visits |
| 73 | + |
| 74 | +Icons and manifest are configured in [vite.config.ts](vite.config.ts) via `vite-plugin-pwa`. |
| 75 | + |
| 76 | +## CI |
| 77 | + |
| 78 | +The [.github/workflows/build.yml](.github/workflows/build.yml) workflow runs on push and pull requests. It: |
| 79 | + |
| 80 | +1. Installs dependencies (with Yarn cache) |
| 81 | +2. Runs `yarn lint` and `yarn build` |
| 82 | +3. Uploads the build output as a **web-build** artifact |
| 83 | + |
| 84 | +Download the artifact from the Actions run summary to get the production `dist/` bundle. |
| 85 | + |
| 86 | +## Donations |
| 87 | + |
| 88 | +Donations help keep the project running. See [DONATIONS.md](DONATIONS.md) for details. |
| 89 | + |
| 90 | +## License |
| 91 | + |
| 92 | +This project is licensed under the **GNU General Public License v3.0**. See [LICENSE](LICENSE) for the full text. |
0 commit comments