Docs update (#229)

This commit is contained in:
kimatata
2025-05-25 21:17:32 +09:00
committed by GitHub
parent 3475b3863c
commit 04981209da
6 changed files with 119 additions and 76 deletions

View File

@@ -1,5 +1,6 @@
--- ---
sidebar_position: 4 sidebar_position: 5
draft: true
--- ---
# Deployment # Deployment

View File

@@ -10,7 +10,7 @@ First, clone the repository.
git clone https://github.com/kimatata/unittcms.git git clone https://github.com/kimatata/unittcms.git
``` ```
and start containers with the following command. and start container with the following command.
```bash ```bash
cd unittcms cd unittcms

View File

@@ -1,28 +1,56 @@
--- ---
sidebar_position: 5 sidebar_position: 4
--- ---
# Override settings # Override settings
The system will work with default settings without setting environment variables, but you can override the settings by placing `.env` file. UnitTCMS will work with the default settings, but you can override them as needed.
## setting frontend environment variables :::warning[Strongly Recommended]
Create `.env` File on `frontend/` It is strongly recommended to change `SECRET_KEY` from the default value in production.
:::
## Docker
If you are self-hosting UnitTCMS with Docker, you can customize the environment using the `environment` section in `docker-compose.yaml`.
```yaml title="docker-compose.yaml"
services:
unittcms:
image: unittcms:latest
build: .
ports:
- '8000:8000'
// highlight-start
environment:
- PORT=8000
- SECRET_KEY=your_secret_key_here
- IS_DEMO=false # set to true to seed the database
// highlight-end
volumes:
- db-data:/app/backend/database
volumes:
db-data:
```
## From Source
If you are self-hosting UnitTCMS from source, you can override the environment by placing `.env` files in the appropriate directory.
### Setting frontend environment variables
Create a `.env` file in the `frontend/` directory:
```.env title="frontend/.env" ```.env title="frontend/.env"
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:8001 NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:8001
``` ```
## setting backend environment variables ### Setting backend environment variables
Create `.env` File on `backend/` Create a `.env` file in the `backend/` directory:
:::warning[Strongly Recommended]
It is strongly recommended to set SECRET_KEY in production.
:::
```.env title="backend/.env" ```.env title="backend/.env"
FRONTEND_ORIGIN=http://localhost:8000 FRONTEND_ORIGIN=http://localhost:8000

View File

@@ -0,0 +1,75 @@
---
sidebar_position: 3
---
# Running UnitTCMS from Source
While using Docker is the recommended and easiest way to run UnitTCMS, this chapter explains how to run it directly from source. This approach is useful for those who cannot use Docker or are interested in contributing to UnitTCMS development. Since the frontend and backend are completely decoupled, this setup also supports more advanced use cases — such as serving the frontend via AWS S3 + CloudFront, or replacing the default SQLite database with another backend solution.
:::info[Prerequisite]
Prerequisite: v20 or higher node must be installed.
:::
To use UnitTCMS, you need to run both frontend server and backend(API) server.
First, clone the repository.
```bash
git clone https://github.com/kimatata/unittcms.git
```
## Run backend server
Place the .env file at `backend/.env`.
```.env title="backend/.env"
FRONTEND_ORIGIN=http://localhost:8000
```
Move to backend directory, then install dependencies.
```bash
cd backend
npm install
```
Initialize the database with the following command.
```bash
npm run migrate
```
Start backend server.
```bash
npm run start
```
## Run frontend server
Move to frontend directory, then install dependencies.
Place the .env file at `frontend/.env`.
```.env title="frontend/.env"
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:8001
```
```bash
cd frontend
npm install
```
Build frontend code
```bash
npm run build
```
Start frontend server
```bash
npm run start
```

View File

@@ -1,61 +0,0 @@
---
sidebar_position: 3
---
# Running UnitTCMS manually
:::info[Prerequisite]
Prerequisite: v20 or higher node must be installed.
:::
To use UnitTCMS, you need run frontend server and backend(API) server.
First, clone the repository.
```bash
git clone https://github.com/kimatata/unittcms.git
```
## Run backend server
Move to backend directory, then install dependencies.
```bash
cd backend
npm ci
```
Initialize the database with the following command.
```bash
npm run migrate
```
Start backend server.
```bash
npm run start
```
## Run frontend server
Move to frontend directory, then install dependencies.
```bash
cd frontend
npm ci
```
Build frontend code
```bash
npm run build
```
Start frontend server
```
npm run start
```

View File

@@ -7,4 +7,4 @@ sidebar_position: 1
UnitTCMS is designed for self-hosted use. There are two ways to self-host the application: “Docker” and “Manual”. UnitTCMS is designed for self-hosted use. There are two ways to self-host the application: “Docker” and “Manual”.
- Docker (Recommended) - Docker (Recommended)
- Manual - From Source