Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

docs(core): clarify developing server docs (#9420)

pengx1787331b49b723
diff --git a/.docker/dev/compose.yml.example b/.docker/dev/compose.yml.example
index 624958d99e..4ef3016bd8 100644
--- a/.docker/dev/compose.yml.example
+++ b/.docker/dev/compose.yml.example
@@ -11,7 +11,7 @@ services:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
volumes:
- - ${DATABASE_LOCATION}:/var/lib/postgresql/data
+ - postgres_data:/var/lib/postgresql/data
redis:
image: redis:latest
@@ -26,3 +26,6 @@ services:
networks:
dev:
+
+volumes:
+ postgres_data:
diff --git a/docs/developing-server.md b/docs/developing-server.md
index 19f85cbba6..2216d4a2a2 100644
--- a/docs/developing-server.md
+++ b/docs/developing-server.md
@@ -7,15 +7,25 @@ This document explains how to start server (@affine/server) locally with Docker
## Run required dev services in docker compose
+Running yarn's server package (@affine/server) requires some dev services to be running, i.e.:
+
+- postgres
+- redis
+- mailhog
+
+You can run these services in docker compose by running the following command:
+
```sh
cp ./.docker/dev/compose.yml.example ./.docker/dev/compose.yml
cp ./.docker/dev/.env.example ./.docker/dev/.env
-docker compose -f ./.docker/dev/compose.yml up -d
+docker compose -f ./.docker/dev/compose.yml up
```
## Build native packages (you need to setup rust toolchain first)
+Server also requires native packages to be built, you can build them by running the following command:
+
```sh
# build native
yarn affine @affine/server-native build
@@ -51,6 +61,8 @@ when server started, it will created a default user for testing:
yarn dev
```
+You can login with the user ([email protected] / dev) above to test the server.
+
## Done
Now you should be able to start developing affine with server enabled.