2022-09-09 00:32:01 +08:00
|
|
|
# Development
|
|
|
|
|
|
|
|
Memos is built with a curated tech stack. It is optimized for developer experience and is very easy to start working on the code:
|
|
|
|
|
|
|
|
1. It has no external dependency.
|
|
|
|
2. It requires zero config.
|
|
|
|
3. 1 command to start backend and 1 command to start frontend, both with live reload support.
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
- [Go](https://golang.org/doc/install)
|
|
|
|
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
|
|
|
|
- [Node.js](https://nodejs.org/)
|
2023-04-16 00:47:40 +08:00
|
|
|
- [pnpm](https://pnpm.io/installation)
|
2022-09-09 00:32:01 +08:00
|
|
|
|
|
|
|
## Steps
|
|
|
|
|
2023-10-08 01:06:18 +08:00
|
|
|
1. Pull the source code
|
2022-09-09 00:32:01 +08:00
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/usememos/memos
|
|
|
|
```
|
|
|
|
|
2023-12-23 12:00:03 +08:00
|
|
|
2. Start backend server with [`air`](https://github.com/cosmtrek/air) (with live reload)
|
2022-09-09 00:32:01 +08:00
|
|
|
|
|
|
|
```bash
|
|
|
|
air -c scripts/.air.toml
|
|
|
|
```
|
|
|
|
|
2023-10-08 01:06:18 +08:00
|
|
|
3. Install frontend dependencies and generate TypeScript code from protobuf
|
2023-09-17 20:55:34 +08:00
|
|
|
|
|
|
|
```
|
2023-10-08 01:06:18 +08:00
|
|
|
cd web && pnpm i && pnpm type-gen
|
2023-09-17 20:55:34 +08:00
|
|
|
```
|
|
|
|
|
2023-10-08 01:06:18 +08:00
|
|
|
4. Start the dev server of frontend
|
2022-09-09 00:32:01 +08:00
|
|
|
|
|
|
|
```bash
|
2023-10-08 01:06:18 +08:00
|
|
|
cd web && pnpm dev
|
2022-09-09 00:32:01 +08:00
|
|
|
```
|
|
|
|
|
2022-12-25 10:39:45 +08:00
|
|
|
Memos should now be running at [http://localhost:3001](http://localhost:3001) and change either frontend or backend code would trigger live reload.
|