# Forumlify正在拆分INDEX.HTML

**URL:** <https://www.nodeloc.com/t/topic/102701>\
**Category:** Forumlify\
**Created:** [2026 年8 月 9 日 08:55 UTC](https://www.nodeloc.com/t/topic/102701 "2026-08-09T08:55:49Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 08:55 UTC](https://www.nodeloc.com/t/topic/102701/1 "2026-08-09T08:55:49Z")

</div>

按照ds的意思是说拆成

```auto
FORUMLIFY
├── style.css
├── index.html
└── js/
    ├── app.js # 主入口（初始化、路由切换）
    ├── api.js # API 请求封装
    ├── auth.js # 登录/注册/退出
    ├── theme.js # 主题切换
    ├── captcha.js # 验证码
    ├── feed.js # 帖子列表渲染
    ├── post.js # 帖子详情 + 回复
    ├── admin.js # 管理后台（举报、用户、日志、友链、设置）
    └── user.js # 用户主页

```

正在整

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:12 UTC](https://www.nodeloc.com/t/topic/102701/2 "2026-08-09T09:12:51Z")

</div>

我的 PR 都拆完了…

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:14 UTC](https://www.nodeloc.com/t/topic/102701/3 "2026-08-09T09:14:57Z")

</div>

没有吧（？

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:16 UTC](https://www.nodeloc.com/t/topic/102701/4 "2026-08-09T09:16:22Z")

</div>

之前还没有这个文件夹的

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:16 UTC](https://www.nodeloc.com/t/topic/102701/5 "2026-08-09T09:16:43Z")

</div>

看我新的 pr

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:18 UTC](https://www.nodeloc.com/t/topic/102701/6 "2026-08-09T09:18:24Z")

</div>

但是我也拆完了……

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:19 UTC](https://www.nodeloc.com/t/topic/102701/7 "2026-08-09T09:19:06Z")

</div>

我用的是 next.js 重写的…

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:19 UTC](https://www.nodeloc.com/t/topic/102701/8 "2026-08-09T09:19:07Z")

</div>

没有啊

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:19 UTC](https://www.nodeloc.com/t/topic/102701/9 "2026-08-09T09:19:47Z")

</div>

> <https://github.com/Furrium/forumlify/pull/2>
>
> \## Summary
> 
> Migrates Forumlify from the single-file Express app (one 19KB \`serve…r.js\` + one 70KB \`index.html\`) to Next.js 14 with the App Router. Same features, same API paths, modern architecture.
> 
> What changed:
> 
> \- \*\*Backend\*\* — the Express server is now 16 Route Handlers under \`app/api/\*\`. Auth (\`lib/auth.js\` with JWT) and the PG pool (\`lib/db.js\`) are shared modules. All response shapes, status codes, and error messages match the original.
> \- \*\*Frontend\*\* — the \`index.html\` SPA is rewritten as React components (\`components/\`): feed, post detail, reply list, new post, admin (5 tabs), settings, modals. The original CSS-variable theme system moved to \`app/globals.css\` unchanged, so the light/dark look is preserved.
> \- \*\*Uploads\*\* — files are stored in \`uploads/\` (same as before) and served through a \`GET /api/uploads/\[name\]\` route with a rewrite, so image URLs stay \`/uploads/...\`. Also guards against path traversal.
> \- \*\*Networking\*\* — the server binds \`0.0.0.0\` by default so it's reachable from the LAN. Host and port can now be overridden in \`config.js\` (\`SERVER\_HOST\`, \`SERVER\_PORT\`) or via \`HOST\`/\`PORT\` env vars, with \`scripts/start.js\` reading the config.
> \- \*\*Docker\*\* — multi-stage dockerfile using Next.js \`standalone\` output; compose updated (app on 3000).
> \- Removed \`index.html\`, \`server.js\`, \`style.css\` (superseded; history preserved in git).
> 
> \## Verification
> 
> Tested end to end against a fresh PostgreSQL 15 with \`schema.sql\` imported, \`npm run build\` + \`npm start\`:
> 
> \- Auth: register (first user = admin), login, \`/auth/me\` ✓
> \- Posts/replies: create, list, detail, reply ✓
> \- Admin: user list, role change, forum-name setting, reports, logs, links ✓
> \- Upload: image upload + retrieval through \`/uploads/...\` ✓
> \- Access control: unauthenticated → 401, non-admin on admin API → 403 ✓
> \- Bad UUIDs now return 404 instead of a 500 (pg UUID error) ✓
> \- Listens on 0.0.0.0 (verified via LAN IP) ✓
> 
> \`next build\` passes clean; no TypeScript migration included (kept plain JS to limit diff surface — can be a follow-up).
> 
> \## Checklist
> 
> \- \[x\] Builds and runs from source (\`npm run build\` / \`npm start\`)
> \- \[x\] Docker build path updated
> \- \[x\] All original features verified manually (API-level)
> \- \[\] No test suite in repo — verified manually as above
> \- \[\] Breaking: none — API contract and UI preserved

你让 DS 总结一下

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:23 UTC](https://www.nodeloc.com/t/topic/102701/11 "2026-08-09T09:23:54Z")

</div>

那我在干嘛

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:26 UTC](https://www.nodeloc.com/t/topic/102701/12 "2026-08-09T09:26:00Z")

</div>

不知道…

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:26 UTC](https://www.nodeloc.com/t/topic/102701/13 "2026-08-09T09:26:17Z")

</div>

但反正我重写的更现代…

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:27 UTC](https://www.nodeloc.com/t/topic/102701/14 "2026-08-09T09:27:57Z")

</div>

但是现在已经彻彻底底的不兼容了

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:28 UTC](https://www.nodeloc.com/t/topic/102701/15 "2026-08-09T09:28:54Z")

</div>

你的吗？

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:30 UTC](https://www.nodeloc.com/t/topic/102701/16 "2026-08-09T09:30:00Z")

</div>

我通过了你再看一眼仓库

---

<div class="post-metadata">

作者： ![Furry](https://www.nodeloc.com/user_avatar/www.nodeloc.com/furry/32/61704_2.png) [@Furry](https://www.nodeloc.com/u/Furry)\
发布日期： [2026 年8 月 9 日 09:32 UTC](https://www.nodeloc.com/t/topic/102701/17 "2026-08-09T09:32:14Z")

</div>

我先试试看再部署一次

---

<div class="post-metadata">

作者： ![lezi-fun](https://www.nodeloc.com/user_avatar/www.nodeloc.com/lezi-fun/32/45880_2.png) [@lezi-fun](https://www.nodeloc.com/u/lezi-fun)\
发布日期： [2026 年8 月 9 日 09:32 UTC](https://www.nodeloc.com/t/topic/102701/18 "2026-08-09T09:32:56Z")

</div>

看到了
