Skip to content

Latest commit

 

History

History
181 lines (130 loc) · 7.01 KB

README.md

File metadata and controls

181 lines (130 loc) · 7.01 KB

freeCodeCamp 成都社区 官方网站

Anti 996 LICENSE CI & CD

Open in GitHub Codespaces Open in Gitpod

Technology stack

Major examples

  1. Markdown articles
  2. Editor components
  3. Pagination table
  4. Scroll list
  5. Not Found page (NGO)

参与开发

请务必先做好数据子库的准备

安装

# 若网速慢,可启用以下环境变量
# GIT_LFS_SKIP_SMUDGE=1

git clone --recurse-submodules \
  https://github.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io.git \
  ~/Desktop/FCC-CDC/OWS/

cd ~/Desktop/FCC-CDC/OWS/

npm i pnpm -g
pnpm i  &&  pnpm dev

写作

cd ~/Desktop/FCC-CDC/OWS/pages/article/Wiki

git checkout master  # 确保子模块在 master 分支,否则提交推送后会丢失

touch _post/My-Post-title.md
code _post/My-Post-title.md  # 用你喜欢的文本编辑器写作

git add .
git commit -m "[add] A new Post"
git push

开发

cd ~/Desktop/FCC-CDC/OWS/

git submodule update --remote  # 程序开发后要同步文章目录
git checkout -b feature/My-Feature

touch pages/my-page.tsx
code pages/my-page.tsx  # 用你喜欢的 IDE 开发

git add .
git commit -m "[add] A new Feature"
git push -u origin feature/My-Feature

Best practice

  1. Install GitHub apps in your organization or account:

    1. Probot settings: set up Issue labels & Pull Request rules
    2. PR badge: set up Online VS Code editor entries in Pull Request description
  2. Click the Use this template button on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above

  3. Click the Open in GitHub codespaces button on the top of ReadMe file, then an online VS Code development environment will be started immediately

  4. Set Vercel variables & Lark chat bot URL as Repository secrets, then every commit will send a Lark message with an independent Preview URL

  5. Remind the PMs & users of your product to submit Feature/Enhancement requests or Bug reports with Issue forms instead of IM messages or Mobile Phone calls

  6. Collect all these issues into Project kanbans, then create Pull requests & add closes #issue_number into its description for automation

Getting Started

First, run the development server:

npm i pnpm -g
pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deployment

Environment variables

name file description
SENTRY_AUTH_TOKEN .env.local Official document
SENTRY_ORG .env Official document
SENTRY_PROJECT .env Official document
NEXT_PUBLIC_SENTRY_DSN .env Official document
LARK_APP_ID .env.local Official document
LARK_APP_SECRET .env.local Official document
NEXT_PUBLIC_CACHE_HOST .env Static files CDN for Lark

Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Docker

pnpm pack-image
pnpm container