Giter VIP home page Giter VIP logo

treehole-frontend-next's Introduction

Treehole Frontend Next

Build

This project use pnpm as package manager. If you haven't install Node.js yet, you can download and install it from https://nodejs.org/

Once you install Node.js, you can run npm install pnpm -g to install pnpm.

To build this project, you should run

pnpm build

which will execute the script scripts.build written in package.json.

The output files will be generated in /dist folder. If you need to review the bundled size, you can check /dist/report.html.

Docker

You can also build this project with docker. To build the image, you can create a docker-compose.yml file like this:

services:
  treehole-frontend-next:
    image: dest1n1/treehole-frontend-next:dev
    container_name: treehole-frontend-next
    environment:
      - VITE_BACKEND_URL=${BACKEND_URL}
      - VITE_AUTH_URL=${AUTH_URL}
      - VITE_AUTH_BASE_URL=${AUTH_BASE_URL}
      - VITE_COOKIE_DOMAIN=${COOKIE_DOMAIN}
    ports:
      - 8080:80

where ${BACKEND_URL}, ${AUTH_URL}, ${AUTH_BASE_URL} and ${COOKIE_DOMAIN} are the environment variables you want to set. You can either set them in the docker-compose.yml file or set them in the environment.

The BACKEND_URL and AUTH_URL are respectively the url of the treehole backend and the auth backend. The AUTH_BASE_URL the url of the auth frontend. The COOKIE_DOMAIN should be the shared domain of the auth frontend and the treehole frontend.

For example, the .env file for the treehole frontend is like this:

BACKEND_URL=https://www.fduhole.com/api/
AUTH_URL=https://auth.fduhole.com/api/
AUTH_BASE_URL=https://auth.fduhole.com/
COOKIE_DOMAIN=.fduhole.com

After you create the docker-compose.yml file and set the environment variables, you can run

docker-compose up -d

to start the container.

Development

Run

You can run

pnpm dev

to launch the dev server.

treehole-frontend-next's People

Contributors

dest1n1s avatar dinosaur39 avatar kyln24 avatar gaia-pygmalion avatar

Stargazers

知之AI学院 微信:jerry0012009 avatar Albert26193 avatar Ke Chen avatar  avatar w568w avatar brandfucker avatar  avatar  avatar

Watchers

w568w avatar  avatar Ke Chen avatar Kostas Georgiou avatar

Forkers

dinosaur39 hasbai

treehole-frontend-next's Issues

[Feature Request] 夜间模式选项记忆开关状态

https://www.fduhole.com/#/hole/191944

在使用 “网页版旦夕树洞” 时,如果在设置中开启了 “夜间模式” 的选项,然后下次登录的时候仍然恢复至 “非夜间模式”。

即,我希望的是,我设置了一次夜间模式后,除非我更改设置,否则我每次打开都是夜间模式。然而现在的情况是,每次打开我都需要去设置中更改 “夜间模式的选项”。

[Bug] 首层无文字内容的洞无法从主页进入

如 洞231333(首层只有一张图片),在洞外显示为:
image
进入某洞的方式似乎是点击预览的文字内容,而在首层只有一张图片的情况下似乎不显示任何预览内容,所以无法点击进入查看全洞。

[Feature Request] Url Scheme 重定向

Url Scheme 可用于分享树洞内容, 以减少截屏的可能. 目前客户端均已支持使用 Url Scheme 跳转和分享, 见 PRCommit.

但许多浏览器/社交软件不支持 danxi://forum/... 等 Scheme 的识别. 现在的解决办法法是将分享链接写成形如 https://url.fduhole.com/forum/floor/... 并交由网页端重定向至 danxi://forum/floor/... . 跳转可以不加载任何元素或者在静态页面中进行, 以减少后端和渲染压力.
具体形式和关键词可以进一步探讨, 客户端 Url Scheme 设计可见飞书文档.

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.