Update README

This commit is contained in:
2024-09-29 22:27:54 +02:00
parent 1c5b60ef21
commit 879c1d96ff

View File

@@ -1,16 +1,35 @@
# NovaMD # NovaMD
Yet another markdown editor. Work in progress Yet another markdown editor. Work in progress
## Features
- Markdown editing with syntax highlighting
- File tree navigation
- Git integration for version control
- Dark and light theme support
- Math equation support (KaTeX)
- Code syntax highlighting
## Prerequisites
- Go 1.23 or later
- Node.js 20 or later
- gcc (for go-sqlite3 package)
## Running the Backend ## Running the Backend
1. Navigate to the `backend` directory 1. Navigate to the `backend` directory
2. Set the `FOLDER_PATH` environment variable to your desired file storage location 2. Set the following environment variables:
- `CGO_ENABLED=1`: This is necessary for the go-sqlite3 package
- `NOVAMD_DB_PATH`: Path to the SQLite database file (default: "./sqlite.db")
- `NOVAMD_WORKDIR`: Directory for storing Markdown files (default: "./data")
- `NOVAMD_STATIC_PATH`: Path to the frontend build files (default: "../frontend/dist")
- `NOVAMD_PORT`: Port to run the server on (default: "8080")
3. Run the server: 3. Run the server:
``` ```
go run cmd/server/main.go go run cmd/server/main.go
``` ```
The server will start on port 8080 by default.
## Running the Frontend ## Running the Frontend
@@ -24,3 +43,31 @@ Yet another markdown editor. Work in progress
npm start npm start
``` ```
The frontend will be available at `http://localhost:3000` The frontend will be available at `http://localhost:3000`
## Building for Production
1. Build the frontend:
```
cd frontend
npm run build
```
2. Build the backend:
```
cd backend
go build -o novamd ./cmd/server
```
3. Set the `NOVAMD_STATIC_PATH` environment variable to point to the frontend build directory
4. Run the `novamd` executable
## Docker Support
A Dockerfile is provided for easy deployment. To build and run the Docker image:
1. Build the image:
```
docker build -t novamd .
```
2. Run the container:
```
docker run -p 8080:8080 -v /path/to/data:/app/data novamd
```