2026-08-09
lezi-fun
9e72e4de8e
chore: allow .env in repo, add .env.example template
...
- .gitignore: track .env, still ignore local overrides (.env.local)
- Add .env.example with DATABASE_URL / JWT_SECRET / PORT / HOST
2026-08-09 21:26:29 +08:00
lezi-fun
7d431a89a7
test: add API integration test suite (40 tests)
...
- node:test based, zero extra dependencies, npm test script
- api.test.js: auth, posts, pagination, replies, 404/401 handling
- admin.test.js: admin API, role management, settings, links, logs
- dm.test.js: private messaging, unread counts, read receipts, 403
- helpers.js: makeAdmin() to guarantee admin role in shared DB
- test/README.md: setup and run instructions
2026-08-09 21:26:03 +08:00
lezi-fun
02ac24ba88
feat: port pagination and drag-drop upload from upstream
...
- GET /api/posts now supports page/limit, returns {data, pagination}
- Feed: pagination controls (‹ page numbers ›), reset to page 1 on sort change
- NewPost: dashed drop zone with click/drag-drop image upload, 5MB limit
- UserProfile adapts to paginated response
2026-08-09 21:14:18 +08:00
lezi-fun
96c3ac3bb9
Merge remote-tracking branch 'origin/main' into nextjs-migration
2026-08-09 21:03:38 +08:00
lezi-fun
300ad5959c
feat: port private messaging (私信) from upstream
...
- Add conversations/messages tables to schema.sql (upstream missed them)
- API: GET/POST /api/conversations, GET/POST /api/conversations/[id]/messages, PUT /api/messages/[id]/read
- Chat UI: conversation list modal, chat window with 3s polling, unread badge
- Navbar message entry opens DM list; user profile has 发私信 button
- Access control: only conversation participants (403 otherwise)
2026-08-09 21:01:55 +08:00
lezi-fun
5ef8d4b1ff
feat: port user profile feature from upstream
...
- GET /api/users?username= filter (admin)
- GET /api/posts?user_id= filter
- Add UserProfile page (profile card + user's posts), reachable via ?user=<username>
- Clickable usernames on feed, post detail, replies
2026-08-09 18:30:49 +08:00
lezi-fun
e6ba5507ae
Merge remote-tracking branch 'origin/main' into nextjs-migration
2026-08-09 18:24:37 +08:00
lezi-fun
e16887a4b3
chore: remove orphaned js/ modules from reverted upstream split
2026-08-09 18:17:53 +08:00
lezi-fun
70a198ae32
fix: restore original Feather icons across UI
...
- Add components/Icons.js with SVG paths extracted verbatim from the original index.html (14 unique icons)
- Restore icons on navbar menu, sidebar, feed actions, post/reply, modals, admin tabs and settings
- Replaces emoji placeholders from the initial migration
2026-08-09 18:12:46 +08:00
lezi-fun
3e9d004fb6
Merge remote-tracking branch 'origin/main' into nextjs-migration
2026-08-09 17:15:57 +08:00
lezi-fun
94cb0f50be
docs: preserve upstream attribution note in README
2026-08-09 17:03:00 +08:00
lezi-fun
281460fb03
feat: migrate to Next.js 14 (App Router + Route Handlers)
...
- Replace Express server with Next.js Route Handlers (16 API routes)
- Rewrite index.html SPA as React components (feed, post, admin, modals)
- Move style.css to app/globals.css with dark/light themes intact
- Add lib/db.js, lib/auth.js (JWT), lib/api.js (client API wrapper)
- Server binds 0.0.0.0 by default; host/port configurable via config.js
- Uploads served via /api/uploads route (rewrite keeps /uploads/ URLs)
- Multi-stage dockerfile using standalone output
2026-08-09 17:02:11 +08:00
lezi-fun
2ffad8422f
Add .gitignore, remove node_modules from repo
2026-08-09 16:28:32 +08:00
lezi-fun
8e3aa558b0
Add source-build docs, optional SERVER_PORT config
2026-08-09 16:28:31 +08:00
lezi-fun
d24b852f2a
Add package-lock.json extracted from built Docker image
2026-08-09 16:28:31 +08:00