Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
723 changes: 723 additions & 0 deletions docs/ARCHITECTURE.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/features/dashboard/ui/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Dashboard UI components barrel export
export { default as AttendacePanel } from './AttendacePanel';
export { default as CharacterPanel } from './CharacterPanel';
export { default as CharacterSpeedRow } from './CharacterSpeedRow';
export { default as ExitPanel } from './ExitPanel';
export { default as HighlightsPanel } from './HighlightsPanel';
export { default as LevelProgressPanel } from './LevelProgressPanel';
export { default as MainHeader } from './MainHeader';
export { default as MiniRunningPanel } from './MiniRunningPanel';
export { default as PosePatternPanel } from './PosePatternPanel';
export { default as RunningPanel } from './RunningPanel';
export { default as TotalDistanceModal } from './TotalDistanceModal';
export { default as TotalDistancePanel } from './TotalDistancePanel';
export { default as TrendPanel } from './TrendPanel';
export { default as WebcamPanel } from './WebcamPanel';
1 change: 0 additions & 1 deletion src/main/src/security-restrictions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ app.on('web-contents-created', (_, contents) => {
* 개발 모드에서는 허용하고 프로덕션에서만 막기
*/
if (import.meta.env.PROD) {
const originalReload = contents.reload.bind(contents);
contents.reload = () => {
console.warn('Page reload is disabled in production mode');
// 새로고침 실행하지 않음
Expand Down
6 changes: 3 additions & 3 deletions src/preload/exposedInMainWorld.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface Window {
readonly bugi: BugiAPI;
readonly nodeCrypto: NodeCryptoAPI;
readonly electronAPI: ElectronAPI;
readonly bugi: BugiAPI;
readonly nodeCrypto: NodeCryptoAPI;
readonly electronAPI: ElectronAPI;
}
2 changes: 1 addition & 1 deletion src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<body>
<div id="root"></div>
<div id="modal"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src/app/main.tsx"></script>
</body>
</html>
1 change: 1 addition & 0 deletions src/renderer/src/app/dev/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DevNavbar } from './DevNavbar/DevNavbar';
2 changes: 2 additions & 0 deletions src/renderer/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './providers';
export * from './layouts';
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Outlet } from 'react-router-dom';
import Header from './Header/Header';
import Header from './header/Header';
// import { DevNavbar } from '../dev';

const Layout = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Logo from '../../assets/logo.svg?react';
import Symbol from '../../assets/symbol.svg?react';
import { ThemeToggleSwitch } from '../../components/ThemeToggleSwitch/ThemeToggleSwitch';
import { useThemePreference } from '../../hooks/useThemePreference';
import Logo from '@assets/common/icons/logo.svg?react';
import Symbol from '@assets/common/icons/symbol.svg?react';
import { ThemeToggleSwitch } from '@shared/ui/theme-toggle-switch';
import { useThemePreference } from '@shared/hooks/use-theme-preference';

const Header = () => {
const [isDark, setIsDark] = useThemePreference();
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/app/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Layout } from './Layout';
export { default as Header } from './header/Header';
4 changes: 2 additions & 2 deletions src/renderer/src/main.tsx → src/renderer/src/app/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import App from './App';
import './index.css';
import App from './providers/App';
import '../index.css';

// React Query 클라이언트 생성
const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RouterProvider } from 'react-router-dom';
import { router } from './routers';
import { router } from '@shared/config/router';

function App() {
const queryClient = new QueryClient();
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/app/providers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as App } from './App';
77 changes: 0 additions & 77 deletions src/renderer/src/components/WidgetController/WidgetController.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions src/renderer/src/components/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/renderer/src/components/pose-detection/index.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/renderer/src/entities/dashboard/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { useAttendanceQuery } from './use-attendance-query';
export { useAverageScoreQuery } from './use-average-score-query';
export { useHighlightQuery } from './use-highlight-query';
export { useLevelQuery } from './use-level-query';
export { usePostureGraphQuery } from './use-posture-graph-query';
export { usePosturePatternQuery } from './use-posture-pattern-query';
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import {
AttendanceQueryParams,
AttendanceResponse,
} from '../../types/dashboard/attendance';
import api from '../api';
import api from '@shared/api';
import { AttendanceQueryParams, AttendanceResponse } from '../types';

/**
* 출석 현황 조회 API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import api from '../api';
import { AverageScoreResponse } from '../../types/dashboard/averageScore';
import api from '@shared/api';
import { AverageScoreResponse } from '../types';

/**
* 평균 자세 점수 조회 API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import {
HighlightQueryParams,
HighlightResponse,
} from '../../types/dashboard/highlight';
import api from '../api';
import api from '@shared/api';
import { HighlightQueryParams, HighlightResponse } from '../types';

/**
* 하이라이트 조회 API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import api from '../api';
import { LevelResponse } from '../../types/dashboard/level';
import api from '@shared/api';
import { LevelResponse } from '../types';

/**
* 레벨 도달 현황 조회 API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import api from '../api';
import { PostureGraphResponse } from '../../types/dashboard/postureGraph';
import api from '@shared/api';
import { PostureGraphResponse } from '../types';

/**
* 바른 자세 점수 그래프 조회 API (최근 31일)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import api from '../api';
import { PosturePatternResponse } from '../../types/dashboard/posturePattern';
import api from '@shared/api';
import { PosturePatternResponse } from '../types';

/**
* 자세 패턴 분석 조회 API
Expand Down Expand Up @@ -34,5 +34,3 @@ export const usePosturePatternQuery = () => {
retry: 1, // 실패 시 1번만 재시도
});
};


22 changes: 22 additions & 0 deletions src/renderer/src/entities/dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export * from './api';
export * from './types';

// 타입 명시적 export
export type {
AttendancePeriod,
AttendanceData,
AttendanceResponse,
AttendanceQueryParams,
AverageScoreData,
AverageScoreResponse,
HighlightPeriod,
HighlightData,
HighlightResponse,
HighlightQueryParams,
LevelData,
LevelResponse,
PostureGraphData,
PostureGraphResponse,
PosturePatternData,
PosturePatternResponse,
} from './types';
97 changes: 97 additions & 0 deletions src/renderer/src/entities/dashboard/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export type AttendancePeriod = 'WEEKLY' | 'MONTHLY' | 'YEARLY';

export interface AttendanceData {
attendances: Record<string, number>; // 날짜별 레벨 값 (예: "2025-01-01": 3)
title: string;
content1: string;
content2: string;
subContent: string;
}

export interface AttendanceResponse {
timestamp: string;
success: boolean;
data: AttendanceData;
code: string;
message: string;
}

export interface AttendanceQueryParams {
period: AttendancePeriod;
year: number;
month?: number;
}

export interface AverageScoreData {
score: number;
}

export interface AverageScoreResponse {
timestamp: string;
success: boolean;
data: AverageScoreData;
code: string;
message: string | null;
}

export type HighlightPeriod = 'WEEKLY' | 'MONTHLY' | 'YEARLY';

export interface HighlightData {
current: number;
previous: number;
}

export interface HighlightResponse {
timestamp: string;
success: boolean;
data: HighlightData;
code: string;
message: string;
}

export interface HighlightQueryParams {
period: HighlightPeriod;
year: number;
month?: number;
}

export interface LevelData {
level: number;
current: number;
required: number;
}

export interface LevelResponse {
timestamp: string;
success: boolean;
data: LevelData;
code: string;
message: string | null;
}

export interface PostureGraphData {
points: Record<string, number>;
}

export interface PostureGraphResponse {
timestamp: string;
success: boolean;
data: PostureGraphData;
code: string;
message: string | null;
}

export interface PosturePatternData {
worstTime: string; // "14:00:00" 형식
worstDay: string; // "FRIDAY" 형식
recovery: number; // 회복까지 평균 시간 (분)
stretching: string; // 스트레칭 추천
}

export interface PosturePatternResponse {
timestamp: string;
success: boolean;
data: PosturePatternData;
code: string;
message: string;
}
13 changes: 13 additions & 0 deletions src/renderer/src/entities/posture/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export * from './lib';
export * from './model';

// 타입 명시적 export
export type {
PoseLandmark,
WorldLandmark,
PIResult,
FrontalityResult,
PostureClassification,
CalibrationState,
CalibrationFrame,
} from './lib/types';
Loading