HNU-TimeLetter is a live-data application: every story, map pin, creation-board card, and contributor credit is pulled from Feishu Bitable at sync time and served from typed JSON files at runtime. This guide walks you from a fresh clone to a fully running local development server in four steps, assuming you already have valid Feishu app credentials and an Aliyun OSS bucket available.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/HNU-himematsu/HNU-TimeLetter/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repository and install dependencies
Ensure you are running Node.js 20 or later before proceeding. The project uses Clone the repository and install all dependencies with a single command:
tsx to execute TypeScript scripts directly, and Turbopack for the dev server — both require a modern Node runtime.npm install resolves both production dependencies (Next.js, Framer Motion, Zustand, Lenis, @waaark/luge, node-schedule, dotenv) and dev dependencies (TypeScript, Tailwind CSS v4, ESLint, tsx).Copy .env.example and fill in your credentials
The repository ships an Open Feishu Bitable table identifiers (obtained from each table’s URL in Feishu):Aliyun OSS (image attachment storage):Admin authentication (required to access The default values for sync runtime variables are already pre-filled in
.env.example that lists every variable the application reads. Copy it to .env.local — Next.js loads .env.local automatically and it is excluded from version control by .gitignore..env.local in your editor and fill in the following key groups. All variables are documented in detail on the Environment Variables page.Feishu app credentials (required for all sync operations):/admin):.env.example and are safe to keep as-is for local development:The frontend activity-notice Feishu document popup calls
/api/feishu-jsapi-signature. For that specific feature to work in a local browser session you need FEISHU_APP_ID and FEISHU_APP_SECRET set, and the target Feishu document must grant read access to your app.Run the Feishu sync to populate src/data/
With credentials in place, pull all content from Feishu Bitable and write it to the local JSON artifacts:Under the hood this executes A successful sync prints a summary of records fetched and assets uploaded. If any Feishu or OSS credential is missing or incorrect, the script will exit with a non-zero code and print the offending variable name.
tsx src/scripts/sync-feishu.ts, which:- Authenticates with the Feishu Open API using
FEISHU_APP_IDandFEISHU_APP_SECRETto obtain a tenant access token. - Fetches all records from the homepage stories table (
FEISHU_TABLE_ID/FEISHU_VIEW_ID), the creation board tables, and the contributors table. - Downloads image attachments referenced in Feishu records.
- Uploads each image to your Aliyun OSS bucket and rewrites the attachment field with the public OSS URL.
- Shapes the fetched data into the domain types defined in
src/lib/types.tsand writes three JSON files:
Start the development server
http://localhost:3000. The four application routes are immediately accessible:| URL | What you will see |
|---|---|
http://localhost:3000 | Envelope opening ritual → scroll through About, Credits, and Footer sections |
http://localhost:3000/map | Interactive campus map (desktop) or stamp-collection waterfall (mobile) |
http://localhost:3000/creation | Community creation board — sticky-note masonry grid |
http://localhost:3000/admin | Admin login — enter ADMIN_PASSWORD to access the sync dashboard |
src/components/ or pages in src/app/ will trigger instant in-browser updates without a full page reload.Production Build
When you are ready to verify a production-quality build locally, run:next build, compiling and optimising the application for production. For a workflow that mirrors the CI pipeline — sync first, then build — use the combined script:
In a self-hosted production environment, GitHub Actions on the
release branch runs the full quality gate → sync → build → deploy pipeline automatically. Environment variables (FEISHU_*, ALIYUN_*, ADMIN_*) must be configured as repository or environment secrets in GitHub Actions settings.