mili是一个开源的社区系统,界面优雅,功能丰富。已在米粒网 得到应用,你完全可以用它来搭建自己的社区。mili的前端使用vue、iview等技术来开发,后端使用typescript、nodejs、nestjs、typeorm等技术来开发。
Github: https://github.com/shen100/mili
🎆 系统截图
👉 依赖的软件
软件 | 版本 |
---|---|
nginx | 1.17.1 |
node.js | 8.4.0 |
mysql | 5.6.35 |
redis | 4.0.1 |
⚙️ 配置
配置hosts
127.0.0.1 dev.golang123.com
配置nginx
请参考如下配置, 请修改日志目录
upstream nodejsAPI {
server 127.0.0.1:9905;
}
upstream nodejsStatic {
server 127.0.0.1:9906;
}
server {
listen 80;
server_name dev.golang123.com;
access_log /your/path/logs/golang123.access.log;
error_log /your/path/logs/golang123.error.log;
location /js {
proxy_pass http://nodejsStatic;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /styles {
proxy_pass http://nodejsStatic;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /images {
proxy_pass http://nodejsStatic;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /fonts {
proxy_pass http://nodejsStatic;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /sockjs-node {
proxy_pass http://nodejsStatic;
proxy_read_timeout 3600s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /webpack-dev-server {
proxy_pass http://nodejsStatic;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1 {
proxy_pass http://nodejsAPI;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header x-forwarded-proto https;
}
location / {
proxy_pass http://nodejsAPI;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header x-forwarded-proto https;
}
}
配置数据库
请修改{项目目录}/src/config/cfg.default.ts 文件中mysql的配置
export default {
db: {
type: 'mysql',
host: 'localhost',
port: 3306,
...
},
redis: {
host: '127.0.0.1',
port: 6379,
keyPrefix: 'mili:',
family: 4, // 4 (IPv4) or 6 (IPv6)
password: '',
db: 0,
},
...
}
🚀 安装
安装依赖的模块
进入项目目录,输入命令
npm install
进入 {项目目录}/pc 目录下,输入命令
npm install
再输入
npm start
🚕 运行
配置vscode
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register",
],
"args": [
"${workspaceFolder}/src/main.ts",
"|",
"./node_modules/.bin/pino-pretty"
],
"env": {
"NODE_ENV": "development"
},
"sourceMaps": true,
"cwd": "${workspaceFolder}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
通过vscode来运行
按快捷键F5
来运行项目
访问
License
GPL
Mili is GPL licensed.
666
golang 的域名 网站 用nest开发。。。。。
@cllgeek 这个关注过,以前是go,但是前端有 vue ,所以 vue +go+nginx+node 部署下来很麻烦。后来他们就干脆~
首屏渲染真的太快了
@cllgeek https://www.nodejs123.com/
这下满意了吗?😀
@shen100 满意
@shen100 满意
掘金+简书?
@yuu2lee4 被你看出来了,哈哈
还是把UI改了吧。 这抄的太明显了。
大佬,我的这个和你的好像,哈哈 https://github.com/maoxiaoquan/kite
@maoxiaoquan 恩,都是掘金 + 简书, 你的域名不错哦