ddadaal / yaarxiv

Yet Another ArXiv

Home Page:https://cnarxiv.cstam.org.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yaarxiv: Yet Another ArXiv

Frontend Build and Deploy Status Backend Build and Deploy Status Backend Coveralls

A new open-source and modern preprint platform.

Development

A Node.js TypeScript full stack

Start backend:

cd backend
npm install
npm run devenv
npm run dev

Develop frontend using real backend

cd frontend
npm install
npm run devapi

More commands can be found in frontend/README.md and backend/README.md.

Deployment

  1. Configure db initial password in .env
  2. Create and modify backend/config/production.yml based on backend/config/production.sample.yml
  3. docker-compose up

Default configs are provided in docker-compose.yml. The following can be changed.

config default value extra
frontend port 3000 mapped from 3000
backend port 5000 mapped from 3000
frontend args (see below) USE_MOCK=0
static files directory ./static
backend configuration file ./backend/config/production.yml Must be created before starting.
backend db files ./files/db MySQL
backend upload dir ./files/upload

Note: The default timeout for db connection is 20s, which can be changed at the backend configuration file. Because of this connection timeout, there is no need to use wait-for-it.sh to wait for db connection.

Build

# CWD is ., not inside frontend or backend

# Build frontend image 
# The USE_MOCK must be provided during build
docker build . -f frontend/Dockerfile \
    --build-arg USE_MOCK=0 \
    --tag frontend

# Run frontend container at port 3000
# As well as setting env config
# Extra args can be found at ./frontend/README.md
docker run -p 3000:3000 -it \
    -e API_ROOT=http://localhost:5000 \
    frontend

# Build backend image. 
# The configuration can be mapped when run
docker build . -f backend/Dockerfile \
    --tag backend

# Run the backend at 5000
# with mappings to production conf and upload folder
# -it to ctrl+c to kill the container
docker run -p 5000:5000 -it \
    -v $PWD/backend/config/production.yml:/dist/config/production.yml \
    -v $PWD/upload:/dist/upload \
    backend

License

AGPL 3.0

About

Yet Another ArXiv

https://cnarxiv.cstam.org.cn/

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 99.2%Language:Dockerfile 0.5%Language:JavaScript 0.3%Language:Shell 0.0%