56 Commits

Author SHA1 Message Date
aa3e2d40d2 feat: add data explorer API for viewing collected stocks/ETFs/prices
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:33:11 +09:00
bffca88ce9 feat: add POST /rebalance/calculate endpoint with manual prices
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:30:22 +09:00
8c00359a50 feat: add rebalance calculation with manual prices and additional_buy strategy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:28:40 +09:00
de77d5b2aa feat: add rebalance calculate schemas and tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:27:47 +09:00
6d7cf340ea feat: add historical data import script from data.txt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:27:36 +09:00
08710a6dba fix: remove nonexistent change column from price collector OHLCV mapping
All checks were successful
Deploy to Production / deploy (push) Successful in 1m10s
pykrx get_market_ohlcv returns 6 data columns (시가/고가/저가/종가/거래량/거래대금),
not 7. The 등락률 (change) column does not exist, causing a length mismatch error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:27:23 +09:00
8b9fe7064c fix: correct pykrx ETF module import path and method call
All checks were successful
Deploy to Production / deploy (push) Successful in 1m42s
The pykrx library uses 'etx' not 'etf' as the module directory name,
and fetch() is the proper method that returns a DataFrame.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:27:41 +09:00
4261e9c777 fix: switch StockCollector and ValuationCollector from KRX CSV to pykrx
Some checks failed
Deploy to Production / deploy (push) Failing after 1m37s
KRX CSV download endpoint blocks requests from cloud/server IPs,
causing "No columns to parse from file" errors. Replaced with pykrx's
JSON-based API (get_market_ticker_list, get_market_cap_by_ticker,
get_market_fundamental_by_ticker) which is more reliable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 23:08:50 +09:00
ecb3dca571 feat: add ETF data collectors and admin API endpoints
Add ETFCollector (KRX master data) and ETFPriceCollector (pykrx OHLCV)
with corresponding admin API endpoints and frontend collection UI buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 23:00:27 +09:00
72c72994b2 fix: collector error
All checks were successful
Deploy to Production / deploy (push) Successful in 1m8s
2026-02-08 22:48:35 +09:00
9f756331c4 fix: remove passlib dependency and fix FastAPI deprecation warnings
All checks were successful
Deploy to Production / deploy (push) Successful in 1m9s
- Replace passlib with direct bcrypt usage to eliminate the
  'module bcrypt has no attribute __about__' warning
- Change Query(regex=) to Query(pattern=) per FastAPI deprecation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:34:32 +09:00
1dae2945c3 feat: client-side password hashing and admin user auto-seeding
All checks were successful
Deploy to Production / deploy (push) Successful in 1m31s
- Hash passwords with SHA-256 on frontend before transmission to prevent
  raw password exposure in network traffic and server logs
- Switch login endpoint from OAuth2 form-data to JSON body
- Auto-create admin user on startup from ADMIN_USERNAME/ADMIN_PASSWORD
  env vars, solving login failure after registration was disabled
- Update auth tests to match new SHA-256 + JSON login flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:21:36 +09:00
d6e45d01a6 feat: disable user registration endpoint
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
Personal-use service — no new account creation needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 00:17:21 +09:00
39d2226d95 feat: production deployment setup with Gitea Actions CI/CD
Some checks failed
Deploy to Production / deploy (push) Failing after 46s
- Remove nginx from docker-compose.prod.yml (NPM handles reverse proxy)
- Add Next.js rewrites to proxy /api/* to backend (backend fully hidden)
- Bind frontend to 127.0.0.1:3000 only (NPM proxies externally)
- Replace hardcoded localhost:8000 in history page with api client
- Make CORS origins configurable via environment variable
- Restrict CORS methods to GET/POST/PUT/DELETE
- Add Gitea Actions deploy workflow with secrets-based env management
- Add security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy)
- Add BACKEND_URL build arg to frontend Dockerfile for standalone builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 23:09:22 +09:00
642514b227 chore: upgrade dependencies to latest compatible versions
- Node.js: 22 → 24 (Active LTS)
- PostgreSQL: 15 → 18
- FastAPI: 0.115.6 → 0.128.2
- Uvicorn: 0.34.0 → 0.40.0
- SQLAlchemy: 2.0.36 → 2.0.46
- Alembic: 1.14.0 → 1.18.3
- Pydantic: 2.10.4 → 2.12.5
- pandas: 2.2.3 → 2.3.3
- pykrx: 1.0.45 → 1.2.3
- React: 19.2.3 → 19.2.4

Breaking changes:
- Migrate from python-jose to PyJWT for JWT handling
- numpy downgraded to 1.26.4 for pykrx compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 11:12:16 +09:00
1dcb381a36 chore: 오류 수정, 실행 시 alembic 적용 2026-02-07 10:25:14 +09:00
d6f7d4a307 refactor: rename project from Galaxy-PO to Galaxis-Po
- Update all references in frontend, backend, and docker configs
- Update README, pyproject.toml, layout, sidebar
- Docker container names updated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 23:24:53 +09:00
bfcb155a4f chore: uv 적용 2026-02-04 22:26:19 +09:00
efcfc0e090 feat: add E2E tests for backend and frontend
Backend (pytest):
- Auth flow tests (login, token, protected routes)
- Portfolio CRUD and transaction tests
- Strategy endpoint tests
- Backtest flow tests
- Snapshot and returns tests

Frontend (Playwright):
- Auth page tests
- Portfolio navigation tests
- Strategy page tests
- Backtest page tests
- Playwright configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:30:13 +09:00
e3b9ec1071 feat: update Docker configuration
- Backend Dockerfile: Python 3.12, non-root user, healthcheck
- Frontend Dockerfile: Multi-stage build, production stage
- docker-compose.yml: env_file, healthchecks, restart policies
- docker-compose.prod.yml: Production config with nginx
- .env.example: Updated with all variables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:27:34 +09:00
89bd8fea53 feat: add scheduler, returns calculator, and history page
- APScheduler for daily snapshots (18:30 weekdays)
- ReturnsCalculator with CAGR, TWR, MDD, volatility
- Portfolio history page with snapshots and returns tabs
- FastAPI lifespan integration for scheduler

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:26:16 +09:00
8842928363 feat: add PriceService and snapshot API endpoints
- PriceService: Mock implementation using DB prices
- Snapshot schemas: SnapshotListItem, ReturnsResponse, ReturnDataPoint
- Snapshot API: list, create, get, delete snapshots
- Returns API: portfolio returns calculation with CAGR

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:23:56 +09:00
99bd08c68a feat: add backtest API endpoints
- POST /api/backtest (create and start)
- GET /api/backtest (list)
- GET /api/backtest/{id} (detail)
- GET /api/backtest/{id}/equity-curve
- GET /api/backtest/{id}/holdings
- GET /api/backtest/{id}/transactions
- DELETE /api/backtest/{id}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:51:29 +09:00
c1ee879cb4 feat: add backtest services (portfolio, engine, worker)
- VirtualPortfolio for portfolio simulation
- BacktestEngine for strategy backtesting
- Worker for async background execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:34:48 +09:00
a78c00ecbb feat: add MetricsCalculator service
- Total return, CAGR, MDD, Sharpe ratio, volatility
- Benchmark comparison metrics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:37:19 +09:00
d9d9c8d772 feat: add backtest SQLAlchemy models
- Backtest, BacktestResult, BacktestEquityCurve
- BacktestHolding, BacktestTransaction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:36:37 +09:00
331ab2cc56 feat: add backtest Pydantic schemas
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:35:53 +09:00
bc484fcb07 feat: add market data API endpoints
- GET /api/market/stocks/{ticker}
- GET /api/market/stocks/{ticker}/prices
- GET /api/market/search

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:01:48 +09:00
6a6ccc9c57 feat: add strategy API endpoints
- POST /api/strategy/multi-factor
- POST /api/strategy/quality
- POST /api/strategy/value-momentum

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:01:10 +09:00
3f8ef7e108 feat: add multi-factor, quality, and value-momentum strategies
- BaseStrategy abstract class
- MultiFactorStrategy with weighted factors
- QualityStrategy with F-Score filtering
- ValueMomentumStrategy combining value and momentum

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:59:05 +09:00
9eebc73390 feat: add factor calculator service
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:58:00 +09:00
d671befb90 feat: add quant strategy Pydantic schemas
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:57:05 +09:00
7edc152491 feat: add portfolio detail API with calculated values 2026-02-03 07:11:19 +09:00
5f3c6061c9 feat: add rebalancing API endpoints 2026-02-03 07:09:26 +09:00
a45c44740e feat: add rebalancing calculation service 2026-02-03 07:08:55 +09:00
95f97eeef9 feat: add transactions API with holdings update 2026-02-03 07:08:21 +09:00
8ad2a62466 feat: add targets and holdings API endpoints 2026-02-03 07:07:22 +09:00
5558d96cb9 feat: add portfolio CRUD API endpoints 2026-02-03 07:06:55 +09:00
a3d9819175 feat: add portfolio Pydantic schemas 2026-02-03 07:06:22 +09:00
aec8541563 fix: add parameter validation to admin API
Add Query parameter validation with regex patterns for date fields (YYYYMMDD format) and numeric constraints for limit parameter. Update JobLogResponse to use datetime types instead of strings for proper date serialization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 00:00:18 +09:00
d2c5f91b2b feat: add admin API for data collection management
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:57:47 +09:00
8cc2d3fa41 fix: add validation and rate limiting to ValuationCollector
- Add time import and RATE_LIMIT_DELAY constant for rate limiting between HTTP requests
- Add 1-second delay after OTP request to respect API rate limits
- Validate OTP response is not empty before using it
- Add CSV column structure validation with required columns check
- Add data quality check to skip records where all metrics are None
- Improve error handling and data integrity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:56:05 +09:00
3e723b6146 feat: add valuation data collector
Add ValuationCollector class that fetches PER, PBR, and dividend yield
data from KRX for all listed stocks. Includes business day validation,
safe float conversion, and upsert logic for the valuations table.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:48:08 +09:00
29f727970d fix: add transaction safety and type validation to PriceCollector
- Implement per-ticker commits to ensure atomic operations per data source
- Add rollback on exception to prevent partial data corruption
- Add _safe_float() and _safe_int() helper methods for defensive type conversion
- Validate column count after DataFrame reset to catch schema issues early
- Skip records with missing essential values (close price) with debug logging
- Remove final db.commit() since commits now happen per ticker in the loop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:46:16 +09:00
135d55b488 feat: add price data collector using pykrx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:44:04 +09:00
aed636f2b3 fix: add error handling, validation, and logging to collectors
- Add REQUEST_TIMEOUT and RATE_LIMIT_DELAY constants to StockCollector
- Add timeout parameter to all HTTP requests
- Wrap HTTP requests in try-except with proper error handling
- Add _validate_biz_day() method to both collectors
- Add validation for required fields (ticker, name) before insert
- Replace generic Exception with specific exception types in SectorCollector
- Add logging module and logger to both collectors
- Remove unused numpy import from StockCollector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:42:24 +09:00
5479c36985 feat: add stock and sector data collectors
Implement StockCollector to fetch stock master data from KRX
(Korea Exchange) including market cap, EPS, BPS, and dividend info.
Implement SectorCollector to fetch WICS sector classification from
WISEindex. Both collectors use PostgreSQL upsert for efficient updates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:38:45 +09:00
52d9fdf1f7 fix: add transaction rollback and session validation to BaseCollector
- Add session validation in __init__ to ensure database session is not None
- Implement transaction rollback handling in complete_job() for exception safety
- Implement transaction rollback handling in fail_job() for exception safety
- Improve exception handling in run() to gracefully handle fail_job failures while preserving original exception

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:36:39 +09:00
3abbdfa5b6 feat: add base collector infrastructure for data collection jobs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:34:41 +09:00
39edc202f8 feat: add authentication API with login, register, and user endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:20:32 +09:00