From e8dc9809e2eb4f83ac791dc5ba5c17e594c84605 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Sun, 5 Mar 2023 12:18:56 -0600 Subject: [PATCH] docs: update README.md (#1327) --- apps/web/README.md | 31 +++++++++++++++++++++++++++++++ docs/BUILDING.md | 8 +++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 apps/web/README.md diff --git a/apps/web/README.md b/apps/web/README.md new file mode 100644 index 000000000..522e73e06 --- /dev/null +++ b/apps/web/README.md @@ -0,0 +1,31 @@ +# AFFiNE Web + +This is the web application for AFFiNE. It is a React application that uses the [Next.js](https://nextjs.org/) framework. + +## Getting Started + +First, run the development server: + +```bash +pnpm run dev +``` + +Open [http://localhost:8080](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `src/pages/workspace/[workspaceId]/all.tsx`. The page auto-updates as you edit the file. + +For more information on Next.js, take a look at the [Next.js Documentation](https://nextjs.org/docs). + +## Build Presets + +`preset.config.mjs` contains the build presets for the application. The presets are used to configure the build process for different environments. The presets are: + +- `enableIndexedDBProvider`: Enables the IndexedDB provider for the application. This is used to store data in the browser. +- `enableBroadCastChannelProvider`: Enables the Broadcast Channel provider for the application. This is used to communicate between local browser tabs. +- `prefetchWorkspace`: **deprecated** +- `exposeInternal`: Exposes internal variables into `globalThis` for debugging purposes. +- `enableDebugPage`: Enables the debug page for the application. This is used for debugging purposes. + +## BlockSuite Integration + +Set `LOCAL_BLOCK_SUITE=/path/to/blocksuite` to use a local version of [BlockSuite](https://github.com/toeverything/blocksuite). This is useful for development. diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 1a5d37afb..ad4ec24df 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -1,10 +1,10 @@ -# Building AFFiNE +# Building AFFiNE Web ## Table of Contents - [Prerequisites](#prerequisites) - [Setup Environment](#setup-environment) -- [Play with Playground](#play-with-playground) +- [Start Development Server](#start-development-server) - [Testing](#testing) ## Prerequisites @@ -33,7 +33,7 @@ nvm use --lts pnpm install ``` -## Play with Playground +## Start Development Server ```sh pnpm dev @@ -41,6 +41,8 @@ pnpm dev The playground page should work at [http://localhost:8080/](http://localhost:8080/) +For more details, see [apps/web/README.md](../apps/web/README.md) + ## Testing Adding test cases is strongly encouraged when you contribute new features and bug fixes.