https://github.com/fantasticit/plarum
A simple full stack demo writen by React & Koa
https://github.com/fantasticit/plarum
Last synced: 3 months ago
JSON representation
A simple full stack demo writen by React & Koa
- Host: GitHub
- URL: https://github.com/fantasticit/plarum
- Owner: fantasticit
- License: mit
- Created: 2019-07-08T15:19:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T01:15:31.000Z (about 5 years ago)
- Last Synced: 2025-04-13T13:38:47.844Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 88.9 KB
- Stars: 16
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Plarum
A simple full stack demo writen by React & Koa
Admin is build with React, Redux, and support i18n.
Server is powered by Koa2 + PostgreSQL.
## 启动
服务启动之前先确保 **数据库** 可连接(推荐使用 docker: `docker container run -d -p 5432:5432 --name postgres postgres:11-alpine`)。
数据库相关配置位于 [server/src/config](./server/src/config),请根据需要改动。### 开发模式
1. 首先启动 `api` 服务:
```shell
cd server
npm i
npm run dev
```2. 启动 `admin` 网页:
```shell
cd admin
npm i
npm start
````api` 接口默认运行在 `http://localhost:4000`,`admin` 网页运行在 `http://localhost:3000`。
### 生产模式
1. `api` 服务构建与运行:
```shell
cd server
npm run build
npm start # 可根据需要自行配置 pm2
```2. `admin` 构建:
```shell
cd admin
npm run build
````admin` 是 `React SPA`,构建后需要自行配置 `nginx` 服务。
#### 使用 docker
如果安装了 `docker`,可以使用 `docker-compose` 直接启动本项目。本项目编写了生产模式部署用的 `docker-compose.yml`,直接在项目根目录执行。
```shell
docker-compose build
docker-compose up -d
```然后浏览器打开 `http://localhost:8080` 即可。
## LICENSE
MIT