feat: add growth tracking page and related functionality

- Implemented a new Growth page to track practice time and trends.
- Added API integration for fetching review data.
- Created components for displaying practice statistics and trends.
- Updated navigation titles for the main index and growth pages.
- Removed unused styles from the index page.
- Introduced a Projects management page for adding and editing practice projects.
- Developed a Record form for logging practice sessions with validation.
- Added utility functions for date manipulation and duration formatting.
- Implemented error handling and session management in the practice service.
- Created unit tests for the practice service to ensure reliability.
This commit is contained in:
yuxuanhui
2026-09-29 13:47:26 +08:00
parent 4b42b55928
commit 6224ef5980
49 changed files with 2824 additions and 71 deletions
+7 -2
View File
@@ -11,7 +11,9 @@ import (
"syscall"
"time"
"ballet-island/backend/internal/database"
"ballet-island/backend/internal/httpapi"
"ballet-island/backend/internal/identity"
"github.com/jackc/pgx/v5/pgxpool"
)
@@ -40,8 +42,11 @@ func run() error {
}
defer pool.Close()
startupCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
startupCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
err = pool.Ping(startupCtx)
if err == nil {
err = database.Migrate(startupCtx, pool)
}
cancel()
if err != nil {
return fmt.Errorf("connect database: %w", err)
@@ -53,7 +58,7 @@ func run() error {
}
server := &http.Server{
Addr: addr,
Handler: httpapi.NewHandler(pool.Ping),
Handler: httpapi.NewAppHandler(pool, &identity.WeChat{AppID: os.Getenv("WECHAT_APP_ID"), AppSecret: os.Getenv("WECHAT_APP_SECRET")}, nil),
ReadHeaderTimeout: 5 * time.Second,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,