Next.jsReactSaaS启动器

Trading-Data-Analysis-Agent — Next.js SaaS模板

作者 waqasraza123

基于 Next.js 与 FastAPI 的开源 AI 交易情报 SaaS 启动器,包含确定性市场分析、可解释 AI 说明与仅模拟的代理工作流,不接入券商执行。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-01查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

Next.js 前端与 FastAPI 后端分离,Neon Postgres 作为唯一数据源

02

确定性引擎负责指标、形态、市场状态、信号分类与置信度评分

03

AI 仅解释已持久化证据,不能改写或覆盖源信号

04

包含账户注册登录、RBAC、会话清单与撤销等第一方认证流程

05

提供指挥中心、简报、扫描器、模拟计划与运营面板等产品界面

06

明确不接入券商执行,仅支持人工复核的模拟代理工作流

模板详细介绍

这是一个面向交易情报产品的开源 SaaS 启动器,前端使用 Next.js,后端使用 FastAPI,数据存储采用 Neon Postgres,并附带 Go 编写的市场数据采集边车。它把导入数据、轮询数据和实时 K 线统一为可审计的模型,再以确定性引擎完成指标、形态、市场状态、信号分类、置信度、质量门禁和结果评估;AI 仅用于解释或对比已持久化的证据,不能改写源信号。

产品界面覆盖公开落地页、登录注册、每日工作流(指挥中心、简报、信号分诊、设置复核、扫描器、就绪检查与引导)、研究模块(股票池、基本面、财报、催化剂、候选标的与后台数据操作)、情报模块(确定性信号、证据、情景、历史案例、置信度、质量与结果)、人工复核的模拟计划,以及账户与运营面板(任务队列、Python 与 Go 工作进程、数据源健康、运行时监管与可观测性)。

安全边界明确:不连接券商执行、不自动交易、不生成直接下单指令,不把观察结果当作账户盈亏,不提供受监管的金融建议。本地开发默认使用开发者模式,部署到生产需要迁移 Neon 数据库并配置会话认证;会话令牌以哈希形式存于 Postgres,仅通过安全 HTTP-only Cookie 传输。

Next.jsSaaS启动器

适合你的项目吗?

适用场景

  • 搭建需要可解释信号与证据链的交易情报类 SaaS 产品
  • 在本地或云端快速启动带账户体系与后台任务队列的交易分析原型
  • 为量化研究团队提供确定性信号、历史案例与结果评估的展示界面
  • 作为教学或内部演示环境,展示 AI 解释与确定性分类的边界划分

适合人群

  • 需要交易情报产品垂直起点而非空仪表盘的 SaaS 开发者
  • 希望保留确定性信号作为事实来源、仅用 AI 做解释的工程团队
  • 需要账户、RBAC、后台任务与运营面板等基础能力的全栈项目
  • 明确接受不接入券商执行、仅做模拟计划的产品方向

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    使用 Docker 运行 make dev 可启动 PostgreSQL、Redis、FastAPI 与 Next.js,随后执行 make migrate 和 make seed

  2. 2

    生产部署需配置已迁移的 Neon 数据库,并设置 APP_ENV、DATABASE_URL、AUTH_MODE 等环境变量

  3. 3

    前端需配置 NEXT_PUBLIC_API_BASE_URL、NEXT_PUBLIC_AUTH_MODE、WEB_API_PROXY_BASE_URL 等变量

  4. 4

    数据库凭据、API 密钥和供应商密钥不得放入 NEXT_PUBLIC_* 变量

  5. 5

    数据库集成测试需要显式提供一次性的 TEST_DATABASE_URL,部分供应商与 LLM 测试需单独配置凭据

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 该启动器不提供下单或券商执行连接,也不将模型输出作为金融建议;仅支持人工复核的模拟计划,不能用于真实交易执行。
  • 数据库集成测试必须显式提供一次性的 TEST_DATABASE_URL,且拒绝复用类生产数据库;部分数据源与 LLM 测试需要另行配置凭据。
  • 数据库凭据、API 密钥与数据源密钥不得放入 NEXT_PUBLIC_* 变量,部署时需自行安全管理这些机密。
  • 生产部署需使用已迁移的 Neon Postgres 数据库并配置会话认证等环境变量,本地默认仅为开发者模式。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

It does not place orders, connect to brokers for execution, or present model output as financial advice.

README 原文

Database integration tests require an explicit disposable `TEST_DATABASE_URL`. They refuse production-like database reuse. Some provider and LLM tests require separately configured credentials.

README 原文

Never put database credentials, API keys, or provider secrets in `NEXT_PUBLIC_*` variables.

README 原文

For a deployed first-party account flow, configure the API with a migrated Neon database

README 原文
https://github.com/waqasraza123/Trading-Data-Analysis-Agent/blob/main/LICENSEhttps://github.com/waqasraza123/Trading-Data-Analysis-Agent/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 88 / 100
技术栈
Next.js · React
网站类型
SaaS · 启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-08-28
截图检查日期
2026-10-01

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 6da3a5caa580fda4ea200b772770f50b125385c569bd15d66689ba57f0e26419

2026-10-01T01:07:35.933Z

来源文件 / 仓库
# AI Trading SaaS Starter Kit

[![CI](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/ci.yml/badge.svg)](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/ci.yml)
[![API CI](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/api-ci.yml/badge.svg)](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/api-ci.yml)
[![Web CI](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/web-ci.yml/badge.svg)](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/web-ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-22c55e.svg)](LICENSE)
![Next.js](https://img.shields.io/badge/Next.js_15-React_19-111827?logo=next.js)
![FastAPI](https://img.shields.io/badge/FastAPI-Python_3.12-05998b?logo=fastapi)
![Neon](https://img.shields.io/badge/Neon-Postgres-00e599?logo=postgresql)
![Go](https://img.shields.io/badge/Go-market_worker-00add8?logo=go)
![Safety](https://img.shields.io/badge/safety-no_broker_execution-2563eb)

An open-source, production-minded starter kit for building explainable AI trading intelligence products with Next.js, FastAPI, Neon Postgres, and Go.

It includes market-data ingestion, deterministic analysis, grounded AI explanations, workspace authentication, paper-only agent plans, review workflows, background jobs, and an operator cockpit. It does not place orders, connect to brokers for execution, or present model output as financial advice.

[Live site](https://ai-trading-agent-seven.vercel.app) · [Use this template](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/generate) · [Development guide](docs/development.md) · [Deployment guide](docs/deployment.md)

![AI Trading SaaS Starter Kit landing page](docs/assets/ai-trading-saas-starter-kit.png)

## Why this starter kit

Most SaaS starters stop at billing, authentication, and an empty dashboard. This repository provides a complete vertical foundation for trading-intelligence products:

- Normalize imported, provider-polled, and live candle data into one auditable model.
- Run indicators, patterns, regimes, signal classification, confidence, quality gates, and outcome evaluation deterministically.
- Let AI explain or compare persisted evidence without allowing it to rewrite source signals.
- Review ranked setups, daily briefs, scans, data health, paper plans, outcomes, and journal notes in a real product UI.
- Start with Neon-backed workspace accounts, RBAC, HTTP-only sessions, queues, workers, health checks, and audit trails.
- Keep optional backend modules fail-soft so one unavailable integration does not break the cockpit.

## Included product surfaces

| Area | What is included |
| --- | --- |
| Public product | Developer landing page, starter-kit metadata, GitHub template calls to action, login, and registration |
| Daily workflow | Command center, brief, signal triage, setup review, scanner, readiness, and onboarding |
| Research | Equity universes, fundamentals, earnings, catalysts, candidates, and background data operations |
| Intelligence | Deterministic signals, evidence, scenarios, historical cases, confidence, quality, and outcomes |
| Paper agent | Human-reviewed paper plans and observations with no live-order path |
| Accounts | Neon-backed registration, login, logout, profile, password change, session inventory, revocation, and activity |
| Operations | Job queue, Python workers, Go market worker, provider health, runtime supervisor, and observability |

## Architecture

```mermaid
flowchart LR
    Browser[Next.js web] -->|HTTP-only session proxy| API[FastAPI]
    API --> Neon[(Neon Postgres)]
    API --> Redis[(Redis)]
    Python[Python workers] --> Neon
    Go[Go market worker] --> Neon
    Providers[Market data providers] --> Go
    Imports[CSV / JSON imports] --> API
    API --> Engine[Deterministic intelligence]
    Engine --> Evidence[Persisted evidence]
    Evidence --> AI[Grounded AI explanations]
```

Python owns the API, product workflows, database contracts, and deterministic intelligence. Go is an additive ingestion sidecar. Neon stores the source of truth. Redis supports distributed rate limits and queued work where configured.

Core rule:

```txt
Persisted artifacts are the source of truth. Deterministic engines classify and score. AI may only explain supplied evidence.
```

## Quick start

### 1. Create your repository

Use [this repository as a GitHub template](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/generate), or clone it directly:

```sh
git clone https://github.com/waqasraza123/Trading-Data-Analysis-Agent.git
cd Trading-Data-Analysis-Agent
```

### 2. Start the development stack

Docker is the fastest route to PostgreSQL, Redis, FastAPI, and Next.js:

```sh
make dev
```

In another terminal, apply the schema and seed deterministic defaults:

```sh
make migrate
make seed
```

Open:

```txt
http://127.0.0.1:3000
http://127.0.0.1:3000/command-center
http://127.0.0.1:8000/docs
http://127.0.0.1:8000/health
```

Run without Docker when preferred:

```sh
./scripts/dev-api.sh
./scripts/dev-web.sh
```

## Neon and production authentication

The local stack defaults to developer mode. For a deployed first-party account flow, configure the API with a migrated Neon database:

```txt
APP_ENV=production
DATABASE_URL=postgresql://user:password@pooler-host/database?sslmode=require
AUTH_MODE=session
AUTH_PASSWORD_ENABLED=true
AUTH_PASSWORD_SIGNUP_ENABLED=true
CORS_ALLOWED_ORIGINS=https://your-web.example
```

Configure the web runtime:

```txt
NEXT_PUBLIC_API_BASE_URL=https://your-api.example
NEXT_PUBLIC_APP_NAME=AI Trading SaaS Starter Kit
NEXT_PUBLIC_SITE_URL=https://your-web.example
NEXT_PUBLIC_REPOSITORY_URL=https://github.com/your-name/your-repository
NEXT_PUBLIC_AUTH_MODE=session
WEB_API_PROXY_BASE_URL=https://your-api.example
WEB_AUTH_SESSION_COOKIE=trading_intelligence_session
```

Use a Neon pooled connection string for the application. Run Alembic migrations before enabling traffic. Never put database credentials, API keys, or provider secrets in `NEXT_PUBLIC_*` variables.

Session tokens are stored as hashes in Postgres and transported to the browser only through secure HTTP-only cookies. New passwords use Argon2id; existing PBKDF2 credentials are upgraded after a successful login.

## Customize the starter

- Set the public product name and repository/site URLs in `apps/web/.env.local`.
- Replace the landing-page copy and preview in `apps/web/src/components/marketing`.
- Configure strategy profiles, rule packs, scanner presets, and seeded symbols for your market niche.
- Enable only the providers, workers, LLM layers, and notifications your deployment needs.
- Keep broker execution separate. No order or brokerage contract exists in this starter.

## Repository layout

| Path | Role |
| --- | --- |
| `apps/api` | FastAPI, SQLAlchemy/Alembic, auth/RBAC, intelligence modules, workers, and backend docs |
| `apps/web` | Next.js App Router product, public landing page, auth boundary, cockpit, and Playwright tests |
| `apps/go/market-worker` | Bounded market-data polling/live ingestion sidecar and health endpoints |
| `docs` | Development, deployment, architecture, project state, and operating guidance |

## Quality checks

```sh
make api-check
make web-check
git diff --check
```

Focused commands:

```sh
cd apps/api && ruff check app alembic && pytest
cd apps/web && npm run typecheck && npm run lint && npm run build
cd apps/web && npm run test:e2e
cd apps/go/market-worker && go test ./...
```

Database integration tests require an explicit disposable `TEST_DATABASE_URL`. They refuse production-like database reuse. Some provider and LLM tests require separately configured credentials.

## Safety boundary

The starter kit can ingest market data, persist deterministic intelligence, compose grounded explanations, create paper-only plans, and record observations. It intentionally does not:

- place orders or connect to brokers for execution;
- auto-trade, copy-trade, or create direct order instructions;
- treat observed outcomes as account P&L or broker performance;
- let an LLM mutate source signals or override deterministic classification;
- store raw provider secrets in source, queued payloads, or API responses;
- provide regulated financial advice.

## Documentation

- [Development setup](docs/development.md)
- [Deployment](docs/deployment.md)
- [API guide](apps/api/README.md)
- [Web guide](apps/web/README.md)
- [Authentication](apps/api/docs/auth.md)
- [Workspace setup](apps/api/docs/workspace-setup.md)
- [Daily workflows](apps/api/docs/daily-workflows.md)
- [Equity research](apps/api/docs/equity-research.md)
- [Go market worker](apps/go/market-worker/README.md)
- [Project state](docs/project-state.md)

## Contributing

Keep changes typed, validated, auditable, and covered by focused tests. Preserve deterministic artifacts as the source of truth, route candle data through shared normalization, and keep optional integrations fail-soft. Do not add broker execution or advisory claims under the existing product boundary.

## License

[MIT](LICENSE) © 2026 Waqas Raza
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。