Lark project scaffold based on TypeScript, React, Next.js, Bootstrap & Workbox. And this project bootstrapped with create-next-app.
- Language: TypeScript v5 + MDX v3
- Component engine: Next.js v15
- Component suite: Bootstrap v5
- PWA framework: Workbox v6
- State management: MobX v6
- API router: Koa 3
- CI / CD: GitHub Actions + Vercel
- Monitor service: Sentry
- Markdown articles
- Lark wiki
- Editor components
- Pagination table
- Scroll list
- Not Found page (NGO)
- Global: https://notfound.org/
- Chinese: https://www.dnpw.org/cn/pa-notfound.html
- https://github.com/kaiyuanshe/kaiyuanshe.github.io
- https://github.com/idea2app/idea2app.github.io
- https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io
-
Install GitHub apps in your organization or account:
- Probot settings: set up Issue labels & Pull Request rules
- PR badge: set up Online VS Code editor entries in Pull Request description
-
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
-
Click the Open in GitHub codespaces button on the top of ReadMe file, then an online VS Code development environment will be started immediately
-
Set Vercel variables & Lark chat bot URL as Repository secrets, then every commit will send a Lark message with an independent Preview URL
-
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
-
Collect all these issues into Project kanbans, then create Pull requests & add
closes #issue_numberinto its description for automation
First, run the development server:
npm i pnpm -g
pnpm devOpen 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.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
| name | file | description |
|---|---|---|
JWT_SECRET |
.env.local |
Random String for JSON Web Token encryption |
SENTRY_AUTH_TOKEN |
.env.local |
Official document |
SENTRY_ORG |
.env |
Official document |
SENTRY_PROJECT |
.env |
Official document |
NEXT_PUBLIC_SENTRY_DSN |
.env |
Official document |
NEXT_PUBLIC_LARK_APP_ID |
.env.local |
Official document |
LARK_APP_SECRET |
.env.local |
Official document |
NEXT_PUBLIC_CACHE_HOST |
.env |
Static files CDN for Lark |
CACHE_REPOSITORY |
.env |
GitHub repository for Lark file cache |
NEXT_PUBLIC_LARK_WIKI_URL |
.env |
Entry URL of a Lark wiki |
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.
pnpm pack-image
pnpm container- create & configure your own
CACHE_REPOSITORYwith https://github.com/idea2app/Web-file-cache - set the
NEXT_PUBLIC_CACHE_HOSTenvironment variable to your CDN URL - create an Automation Flow in your Lark BI Table to watch Attachment fields changing, then send an HTTP
POSTrequest tohttps://api.github.com/repos/your-namespace/Web-file-cache/actions/workflows/crawler.yml/dispatcheswith:- the GitHub PAT in the
Authorizationheader https://your.next.js/api/Lark/file/attachment-id/file-nameasurlbody parameter
- the GitHub PAT in the
- your Lark file attachments will be cached in your CDN and loaded by your Lark-Next.js service automatically