18 Commits

Author SHA1 Message Date
89e2fbe0b9 feat: enhance post retrieval with authorization token
- Updated `getPostById` function to accept an optional authorization token.
- Modified `PostPage` to retrieve the token from cookies and pass it to the API call.
- Added smooth transition effects for background and text colors in `globals.css`.
- Cleaned up imports and formatting in `blog-home.tsx`.
- Refactored `blog-post.tsx` to use `MDXRemote` for rendering markdown content.
- Introduced `blog-comment.tsx` and `blog-post-header.client.tsx` components for better structure.
- Added a switch component for dark/light mode toggle in the navbar.
- Updated `Post` model to include a description field.
2025-07-28 08:30:37 +08:00
339d420918 feat: ️ feat: 添加评论 CRUD 操作 2025-07-26 16:26:14 +08:00
e659de23fb ️ feat: refactor sorting parameters in post listing API and components
- Renamed `orderedBy` to `orderBy` and `reverse` to `desc` in ListPostsParams interface and related functions.
- Updated all usages of the sorting parameters in the post listing logic to reflect the new naming convention.

feat: add user-related API functions

- Implemented `getLoginUser` and `getUserById` functions in the user API to fetch user details.
- Enhanced user model to include `language` property.

feat: integrate next-intl for internationalization

- Added `next-intl` plugin to Next.js configuration for improved localization support.
- Removed previous i18n implementation and replaced it with a new structure using JSON files for translations.
- Created locale files for English, Japanese, and Chinese with basic translations.
- Implemented a request configuration to handle user locales and messages dynamically.

fix: clean up unused imports and code

- Removed unused i18n utility functions and language settings from device context.
- Cleaned up commented-out code in blog card component and sidebar.

chore: update dependencies

- Added `deepmerge` for merging locale messages.
- Updated package.json and pnpm-lock.yaml to reflect new dependencies.
2025-07-26 09:48:23 +08:00
5fac42439a ️ feat: add post fetching by ID and improve blog home page
- Implemented `getPostById` API function to fetch a post by its ID.
- Refactored the main page to use a new `BlogHome` component for better organization.
- Added loading state and sorting functionality for posts on the blog home page.
- Integrated label fetching and display on the blog home page.
- Enhanced the blog card component with improved layout and statistics display.
- Updated the navbar to use dynamic configuration values.
- Added Docker support with a comprehensive build and push workflow.
- Created a custom hook `useStoredState` for managing local storage state.
- Added a new page for displaying individual posts with metadata generation.
- Removed unused components and files to streamline the codebase.
2025-07-25 03:58:53 +08:00
abe1099711 ️ feat: update global styles and color variables for improved theming
refactor: change import paths for DeviceContext and GravatarAvatar components

fix: adjust login form API call and update UI text for clarity

feat: add post API for listing posts with pagination and filtering options

feat: implement BlogCard component for displaying blog posts with enhanced UI

feat: create Badge component for consistent styling of labels and indicators

refactor: reintroduce DeviceContext with improved functionality for theme and language management

feat: define Label and Post models for better type safety and structure
2025-07-24 13:12:59 +08:00
9ca307f4d9 ️ feat: add main page layout with navigation and footer
feat: create random labels page

feat: implement login page with OpenID Connect support

feat: add Gravatar component for user avatars

feat: create Navbar component with navigation menu

chore: create Sidebar component placeholder

feat: implement login form with OIDC and email/password options

feat: add reusable button component

feat: create card component for structured content display

feat: implement input component for forms

feat: create label component for form labels

feat: add navigation menu component for site navigation

chore: add configuration file for site metadata

feat: implement device context for responsive design

feat: add utility functions for class name management

feat: define OIDC configuration model

feat: define base response model for API responses

feat: define user model for user data

feat: implement i18n for internationalization support

feat: add English and Chinese translations for login

chore: create index for locale resources

chore: add blog home view placeholder
2025-07-24 09:22:50 +08:00
58c370ec65 implement OIDC configuration management with CRUD operations, add admin routes, and enhance error handling 2025-07-23 03:32:00 +08:00
562b9bd17f add like functionality with Like model, implement like/unlike methods, and update Post and Comment models to track like counts 2025-07-22 22:45:55 +08:00
cbe73121f2 refactor user service methods, implement OIDC login and user management features, and enhance token handling 2025-07-22 20:45:05 +08:00
f07200b0b9 update environment mode handling, refactor user registration logic, and add username/email existence checks 2025-07-22 10:04:42 +08:00
08872ea015 add .env.example file with configuration settings, refactor environment variable access methods 2025-07-22 09:31:58 +08:00
00c28fea9c implement user registration with email verification, enhance error handling, and update database configuration 2025-07-22 09:15:12 +08:00
1f5f67761b refactor project structure by renaming files and updating test function signature 2025-07-22 08:53:40 +08:00
a0d215fa2e implement email verification feature, add captcha validation middleware, and enhance user authentication flow 2025-07-22 08:50:16 +08:00
b9400e0785 update user authentication error handling, add invalid credentials response, and modify .gitignore for data directory 2025-07-22 06:20:25 +08:00
d1a040617f implement user authentication and database initialization, add models for user, comment, label, and OIDC configuration 2025-07-22 06:18:23 +08:00
99a3f80e12 add middleware for authentication and captcha, implement initial API routes for user, post, label, and page 2025-07-18 03:26:15 +08:00
70b653a88b initialize project structure with main, routing, and environment utilities 2025-07-17 04:01:30 +08:00