Github镜像

visuddhinanda 2a34dc5095 过滤 段落号是0的数据 hace 3 años
.env-global 37603c3c44 忽略文件设置 .env -> /.env hace 4 años
app 5190ec98b6 Merge branch 'chanpter_progress' into laravel hace 3 años
bootstrap fd829c1f6d :tada: move to laravel hace 4 años
config e9500e50cf :wrench: add 超级管理员账号id 设置 hace 3 años
dashboard 3b0136c147 初步实现 hace 4 años
database 6f7f969442 增加 我的阅读 hace 3 años
deploy d2b7818868 :bug: use UTC as default timezone hace 4 años
docker 283e9d2719 移动docker到根目录下 hace 4 años
material-ui 70bdeeadd3 :tida: create material-ui@react project hace 4 años
public 2a34dc5095 过滤 段落号是0的数据 hace 3 años
resources 9a51f296c3 :art: 关系数量加bar hace 4 años
routes 946318d59f Merge branch 'laravel' into chanpter_progress hace 3 años
storage fa8c621cd2 add storage/app/tmp hace 4 años
tests fd829c1f6d :tada: move to laravel hace 4 años
v1 48b4fc521a 建立点赞表并迁移旧数据 hace 3 años
.editorconfig fd829c1f6d :tada: move to laravel hace 4 años
.env.example 57c1f90eb6 :wrench: redis namespace hace 4 años
.gitattributes fd829c1f6d :tada: move to laravel hace 4 años
.gitignore 7f2e585c10 ignore *.log hace 4 años
.styleci.yml fd829c1f6d :tada: move to laravel hace 4 años
LICENSE 7ce3cd2090 Initial commit hace 5 años
README.md f10a69c0be :wrench: HELP_SERVER GRAMMAR_SERVER hace 4 años
artisan fd829c1f6d :tada: move to laravel hace 4 años
change-logs.md 76f3ffeba2 :art: 优化打印显示效果 hace 4 años
composer.json a4c5b6e85e :heavy_plus_sign: godruoyi/php-snowflake hace 4 años
package.json fd829c1f6d :tada: move to laravel hace 4 años
phpunit.xml fd829c1f6d :tada: move to laravel hace 4 años
server.php fd829c1f6d :tada: move to laravel hace 4 años
webpack.mix.js fd829c1f6d :tada: move to laravel hace 4 años

README.md

IAPT Pali Canon Platform

About

这是一个开放的基于语料库的巴利语学习和翻译平台。

后端:

  • PHP 8.0+
  • laravel 8.x
  • PostgreSQL v12+
  • Redis

前端

  • jQuery

工具

  • git
  • composer
  • npm or yarn
  • vscode

目录

目录遵从Laravel目录设置。有以下几点差别

  • public/ 包含旧版php程序的全部文件
  • public/tmp 旧版资源文件夹 对于旧版到新版的迁移。应该将旧版 /tmp 拷贝到 /public
  • v1 旧版数据迁移任务脚本
  • deploy 运维代码

安装

请注意。此安装方法只针对开发人员。生产线请参考deploy/README.md

开发环境

使用 Linux 的开发者请参阅 <项目文件夹>/docker/readme.md 容器中包含了全部开发环境。请忽略下面关于开发环境的安装。

PostgreSQL

最小版本v12。下载链接 https://www.postgresql.org/download/

温馨提示:windows环境安装完之后 将 安装目录/bin加入环境变量 PATH。重启电脑。在命令行输入 psql -v 查看版本号。

建立新的数据库,例如 数据库名为iapt: 在命令行输入

psql -U postgres -h localhost
create database iapt

createdb

\q 退出psql

PHP 8

Redis

composer

npm

yarn

Fork

Fork https://github.com/iapt-platform/mint 到你自己的仓库

Clone

git clone https://github.com/<your>/mint.git

安装依赖

项目根目录下运行

composer install
npm install

/public 目录下运行

composer install
npm install

修改配置文件

.env

复制 <项目目录>/.env.example 的一个副本。改文件名为 .env

修改.env

db配置

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=你的数据库名
DB_USERNAME=postgres
DB_PASSWORD=你的数据库密码

ASSETS_SERVER

ASSETS_SERVER :网站资源文件,非用户的图片,音频,视频

public/app/config.php

复制 <项目目录>/public/app/config.example.php 改文件名为config.php

修改config.php

db 设置

define("Database",[
	"type"=>"pgsql",
	"server"=>"localhost",
	"port"=>5432,
	"name"=>"<database name>",
	"sslmode" => "disable",
	"user" => "<user name>",
	"password" => "<your db password>"
]);

Redis 设置

define("Redis",[
	"host" => "<host ip>",
	"port" => <port>,
	"password" => "<redis password>",
	"prefix"=>"aaa://"
]);

ASSETS_SERVER

HELP_SERVER

GRAMMAR_SERVER

参照下文 config.js

public/app/config.js

复制 <项目目录>/public/app/config.example.js 改文件名为config.js

修改config.js

ASSETS_SERVER

ASSETS_SERVER :网站资源文件,非用户的图片,音频,视频

范例:

ip port根据你的dev server修改

var ASSETS_SERVER = "http://127.0.0.1:8000/tmp";

HELP_SERVER

网站帮助文档

  • 直接引用离您最近的 help server

范例:

ip port根据你的 dev server 修改

var HELP_SERVER = "https://help-hk.wikipali.org";

GRAMMAR_SERVER

语法手册文档

  • 直接引用离您最近的 help server

范例:

ip port根据你的 dev server 修改

var GRAMMAR_SERVER = "https://grammar-hk.wikipali.org";

复制巴利语全文搜索单词表

获取pg share dir 在命令行窗口运行

pg_config --sharedir

程序会输出 shardir. createdb

Liunx 把下面/usr/share/postgresql/14替换为你自己的shardir

sudo cp ./public/app/fts/pali.stop /usr/share/postgresql/14/tsearch_data/
sudo cp ./public/app/fts/pali.syn /usr/share/postgresql/14/tsearch_data/

Windows

复制

  • ./public/app/fts/pali.stop
  • ./public/app/fts/pali.syn

到你的 shardir

application encryption key

在<工程目录>下运行

php artisan key:generate

数据库迁移

在根目录下运行

php artisan migrate

Redis数据库填充

在命令行运行<项目目录>下面的命令

Liunx

cd ./v1/scripts
sh ./redis_upgrade.sh

Window

cd ./v1/scripts
./redis_upgrade.bat

语料数据库填充

Liunx

cd ./v1/scripts
sh ./install.sh

Window

cd ./v1/scripts
./install.bat

运行时间较长。本地开发环境大约4小时。

运行时间较长。本地开发环境大约4小时。

运行dev server

php artisan serve

createdb

在浏览器中访问

http://127.0.0.1:8000

应该出现网站首页

createdb