Giter Site home page Giter Site logo

immccn123 / luogu-discussion-archive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from piterator-org/luogu-discussion-archive

0.0 0.0 0.0 1.23 MB

洛谷讨论存档

Home Page: https://lglg.top

License: Other

Shell 0.04% JavaScript 1.89% TypeScript 95.33% CSS 2.72% SCSS 0.02%

luogu-discussion-archive's Introduction

luogu-discussion-archive

依赖

使用 pnpm 管理依赖

pnpm install

构建

pnpm -r run build

数据库

使用 PostgreSQL 作为数据库。

export DATABASE_URL="postgresql://postgres@localhost:5432/luogu_discussion_archive?schema=public" # PostgreSQL 数据库地址,参见:https://pris.ly/d/postgres-connector
pnpm exec prisma migrate deploy

archive

# 配置环境变量
export PORT="3001" # 存档 API 服务监听的端口
export DATABASE_URL="postgresql://localhost/luogu_discussion_archive" # PostgreSQL 数据库地址
export VIEWER_HOST="https://lglg.top" # viewer 调用 API 的 Origin 头,作 CORS 校验之用

# 执行
node ./packages/archive/dist/server.js

viewer

配置

packages/viewer/.env.local 中:

PORT="3000" # viewer 监听的端口
DATABASE_URL="postgresql://localhost/luogu_discussion_archive" # PostgreSQL 数据库地址
COOKIE="__client_id=ffffffffffffffffffffffffffffffffffffffff; _uid=0" # 请求洛谷的 Cookie 头
NEXT_PUBLIC_ARCHIVE_HOST="//lda.piterator.com" # 指向存档 API 服务器的相对地址

开发

cd packages/viewer
pnpm run dev
# 或直接
pnpm --filter viewer run dev

生产

node ./packages/viewer/.next/standalone/packages/viewer/server.js

luogu-discussion-archive's People

Contributors

wxh06 avatar bohanjun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.