Separate Next.js frontend and FastAPI backend, with Neon Postgres as the single source of truth
Trading-Data-Analysis-Agent — Next.js SaaS Template
By waqasraza123
An open-source AI trading intelligence SaaS starter built on Next.js and FastAPI, featuring deterministic market analysis, explainable AI commentary, and paper-only agent workflows, with no broker execution.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Deterministic engine handles indicators, patterns, market regimes, signal classification, and confidence scoring
AI only explains persisted evidence and cannot rewrite or override source signals
Includes first-party authentication flows such as account registration and login, RBAC, session inventory, and revocation
Provides product interfaces including command center, briefing, scanner, paper plans, and operations dashboards
Explicitly does not connect to broker execution and supports only manually reviewed paper agent workflows
Template Details
This is an open-source SaaS starter for trading intelligence products. The frontend uses Next.js, the backend uses FastAPI, data storage uses Neon Postgres, and a market data collection sidecar written in Go is included. It unifies imported data, polled data, and real-time candlesticks into an auditable model, then uses a deterministic engine to produce indicators, patterns, market regimes, signal classifications, confidence scores, quality gates, and outcome evaluations. AI is used only to explain or compare persisted evidence and cannot rewrite source signals.
The product interface covers a public landing page, login and registration, daily workflows (command center, briefing, signal triage, settings review, scanner, readiness checks, and onboarding), research modules (watchlists, fundamentals, earnings, catalysts, candidates, and backend data operations), intelligence modules (deterministic signals, evidence, scenarios, historical cases, confidence, quality, and outcomes), manually reviewed paper plans, and account and operations dashboards (task queues, Python and Go workers, data source health, runtime governance, and observability).
Security boundaries are explicit: no broker execution connection, no automated trading, no direct order instructions, no treating observations as account P&L, and no regulated financial advice. Local development defaults to developer mode; production deployment requires migrating the Neon database and configuring session authentication. Session tokens are stored hashed in Postgres and transmitted only via secure HTTP-only cookies.
Is it right for your project?
Use Cases
- Building a trading intelligence SaaS product that requires explainable signals and an evidence chain
- Quickly starting a trading analysis prototype with an account system and background task queue locally or in the cloud
- Providing quantitative research teams with display interfaces for deterministic signals, historical cases, and outcome evaluations
- Serving as a teaching or internal demo environment to show the boundary between AI explanation and deterministic classification
Suitable For
- SaaS developers who need a vertical starting point for a trading intelligence product rather than an empty dashboard
- Engineering teams that want to keep deterministic signals as the source of truth and use AI only for explanation
- Full-stack projects that need foundational capabilities such as accounts, RBAC, background tasks, and operations dashboards
- Product directions that explicitly accept no broker execution connection and only paper plans
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Run make dev with Docker to start PostgreSQL, Redis, FastAPI, and Next.js, then run make migrate and make seed
- 2
Production deployment requires a migrated Neon database and environment variables such as APP_ENV, DATABASE_URL, and AUTH_MODE
- 3
The frontend requires variables such as NEXT_PUBLIC_API_BASE_URL, NEXT_PUBLIC_AUTH_MODE, and WEB_API_PROXY_BASE_URL
- 4
Database credentials, API keys, and provider keys must not be placed in NEXT_PUBLIC_* variables
- 5
Database integration tests require explicitly providing a one-off TEST_DATABASE_URL, and some provider and LLM tests require separate credential configuration
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis listing covers the free version under the MIT license in the public repository; the free scope is the code of that version and does not mean external services or third-party assets are free.
Must comply with when using
- You may use, modify, commercialize, and distribute the code of this version for free.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- This starter does not provide order placement or broker execution connections, and does not treat model output as financial advice; it supports only manually reviewed paper plans and cannot be used for real trading execution.
- Database integration tests must explicitly provide a one-off TEST_DATABASE_URL and refuse to reuse production-like databases; some data source and LLM tests require separate credential configuration.
- Database credentials, API keys, and data source keys must not be placed in NEXT_PUBLIC_* variables; you must manage these secrets securely during deployment.
- Production deployment requires a migrated Neon Postgres database and environment variables such as session authentication; local defaults are developer mode only.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
It does not place orders, connect to brokers for execution, or present model output as financial advice.
Original 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.
Original README
Never put database credentials, API keys, or provider secrets in `NEXT_PUBLIC_*` variables.
Original README
https://github.com/waqasraza123/Trading-Data-Analysis-Agent/blob/main/LICENSEhttps://github.com/waqasraza123/Trading-Data-Analysis-Agent/blob/main/README.mdFor a deployed first-party account flow, configure the API with a migrated Neon database
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-01. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 88 / 100
- Technologies
- Next.js · React
- Website type
- SaaS · Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-08-28
- Screenshot last checked
- 2026-10-01
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: 6da3a5caa580fda4ea200b772770f50b125385c569bd15d66689ba57f0e26419
2026-10-01T01:07:35.933Z
Source file / repository# AI Trading SaaS Starter Kit
[](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/ci.yml)
[](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/api-ci.yml)
[](https://github.com/waqasraza123/Trading-Data-Analysis-Agent/actions/workflows/web-ci.yml)
[](LICENSE)





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)

## 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
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
