refactor(infra): directory structure (#4615)

This commit is contained in:
Joooye_34
2023-10-18 23:30:08 +08:00
committed by GitHub
parent 814d552be8
commit bed9310519
1150 changed files with 539 additions and 584 deletions

View File

@@ -59,7 +59,7 @@ yarn install
### Build Native Dependencies
Run the following script. It will build the native module at [`/packages/native`](/packages/native) and build Node.js binding using [NAPI.rs](https://napi.rs/).
Run the following script. It will build the native module at [`/packages/frontend/native`](/packages/frontend/native) and build Node.js binding using [NAPI.rs](https://napi.rs/).
This could take a while if you build it for the first time.
Note: use `strip` from system instead of `binutils` if you are running MacOS. [see problem here](https://github.com/toeverything/AFFiNE/discussions/2840)

View File

@@ -22,10 +22,10 @@ To run AFFiNE Desktop Client Application locally, run the following commands:
yarn install
yarn dev
# in packages/native
# in packages/frontend/native
yarn build
# in apps/electron
# in packages/frontend/electron
yarn dev
```
@@ -33,7 +33,7 @@ Now you should see the Electron app window popping up shortly.
## Build
To build the desktop client application, run `yarn make` in `apps/electron`.
To build the desktop client application, run `yarn make` in `packages/frontend/electron`.
Note: you may want to comment out `osxSign` and `osxNotarize` in `forge.config.js` to avoid signing and notarizing the app.
@@ -41,7 +41,7 @@ Once the build is complete, you can find the paths to the binaries in the termin
```
Finished 2 bundles at:
Artifacts available at: <affine-repo>/apps/electron/out/make
Artifacts available at: <affine-repo>/packages/frontend/electron/out/make
```
## CI

View File

@@ -14,21 +14,13 @@ For the debugging purpose, you might need use local OctoBase on port 3000.
The codebase is organized as follows:
- `apps/` contains the source code for the different entry points of the project.
- `web/` contains the source code for the web app.
- `electron/` contains the source code for the Electron app.
- `server/` backend side for AFFiNE, see <https://github.com/toeverything/OctoBase> instead.
- `packages/` contains the source code for all the packages in the repo.
- `cli` contains the source code for the CLI. Development only.
- `component` contains the source code for the UI component library.
- `debug` contains the source code for the debug helper.
- `env` contains the source code for the environment setup.
- `hooks` contains the source code for the custom React hooks.
- `i18n` contains the source code for the internationalization.
- `jotai` contains the source code for the Jotai store atoms.
- `octobase-node` contains the source code for the OctoBase Node.js binding using Rust.
- `templates` contains the source code for the templates.
- `workspace` contains the source code for the workspace related code.
- `packages/` contains all code running in production.
- `backend/` contains backend code, more information from <https://github.com/toeverything/OctoBase>.
- `frontend/` contains frontend code, including the web app, the electron app and business libraries.
- `plugins/` contains all build-in plugins.
- `common` contains the isomorphic code or basic libraries without business.
- `tools/` contains tools to help developing or CI, not used in production.
- `tests/` contains testings across different libraries, including e2e testings and integration testings.
### `@affine/env`
@@ -50,7 +42,7 @@ Current we have two workspace plugin:
- Each workspace plugin has its state and is isolated from other workspace plugins.
- The workspace plugin is responsible for its own state management, data persistence, synchronization, data backup and recovery.
For the workspace API, see [types.ts](../../packages/workspace/src/type.ts).
For the workspace API, see [types.ts](../../packages/frontend/workspace/src/type.ts).
### `@affine/component`

View File

@@ -47,7 +47,7 @@ postgres=# \du
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
```
### Set the following config to `apps/server/.env`
### Set the following config to `packages/backend/server/.env`
```
DATABASE_URL="postgresql://affine:affine@localhost:5432/affine"