Skip to content

Deployment Ready#3

Merged
snowfluke merged 15 commits intosnowfluke:mainfrom
amaruki:main
Feb 23, 2026
Merged

Deployment Ready#3
snowfluke merged 15 commits intosnowfluke:mainfrom
amaruki:main

Conversation

@amaruki
Copy link
Copy Markdown
Contributor

@amaruki amaruki commented Feb 18, 2026

  • change LLM protocol from Gemini API to OpenAI SDK
  • add configuration for deployment
  • secure refresh, schedule start/stop, config API
  • secure config with AdminGuard component
  • add CTA to telegram bot
  • enforces schedule as UTC +7 (WIB)

Add *.log and data/*.json to .gitignore to prevent committing runtime artifacts. Remove existing backend and frontend log files.
Replace @google/genai with openai dependency to interact with the
Antigravity Manager via OpenAI-compatible endpoints. Refactor client
initialization and content generation to use chat completions instead
of the Gemini API structure.

Key changes:
- Update dependency from @google/genai to openai
- Modify generateContent to use openai.chat.completions.create
- Update error handling to detect OpenAI rate limit errors
- Increase test timeout in llm-client.test.ts
- Replace single chat ID config with database-driven user management
- Add `telegram_users` table and related schema migrations
- Implement polling service for handling /start and /stop commands
- Update notification sender to broadcast to all active subscribers
- Automatically deactivate users if bot is blocked (403 Forbidden)
Enable the API server to serve the compiled frontend application from
`web/dist` with SPA fallback support. Update database and config loading
to use absolute paths relative to CWD to ensure correct behavior in
compiled builds. Add build and serve scripts to package.json.
Add ecosystem.config.cjs to support running the application with PM2
using the Bun interpreter.
Add a new section to the configuration page with instructions on how to
subscribe to Telegram alerts for recommendations and anomalies.
This commit introduces a security layer for administrative actions and
enhances user engagement:

- Add `AdminGuard` component and backend middleware to protect sensitive
  endpoints using a password defined in environment variables.
- Refactor `ConfigPage` to require authentication and provide a lock
  mechanism.
- Add `TelegramCallToAction` component to the dashboard to encourage
  bot subscriptions.
- Update documentation with production deployment and PM2 instructions.
Remove verbose comments and exclude /api/analyze-ticker from the
protected paths list to focus security on core administrative endpoints.
Introduces `isMarketOpen` and `getJakartaTime` functions to determine
if the Indonesia Stock Exchange (IDX) is currently trading.

The `monitor` service now utilizes this check to prevent data fetching
and prediction updates from running outside official trading hours
and on weekends, improving efficiency and resource management.
Moved the logic for transforming Yahoo quote data into the internal StockQuote type into a new dedicated function, `mapYahooQuoteToStockQuote`.
This allows the `prediction-tracker` and `monitor` services to directly utilize the comprehensive quote data provided by `updateAllPredictions`, avoiding unnecessary subsequent calls to `fetchCurrentQuote` for details like volume. This improves data flow and reduces API requests.
Integrates Zod for defining and validating LLM response schemas.
The `generateContent` function now supports an optional Zod schema,
enabling automatic validation of LLM output. Implements retry logic
that provides detailed validation errors back to the LLM for self-correction.
This enhances the reliability and consistency of LLM-generated data.
Introduces new `tickerExtractionSchema` and `stockAnalysisSchema`
along with their respective unit tests.
@snowfluke snowfluke merged commit f2fadf2 into snowfluke:main Feb 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants