OmniTrade is an online broker that allows users to research, trade, and manage their stocks.
Features include live unit prices, real-time company news, watchlists and alerts, and cash management.
OmniTrade is live on Azure App Services. The URL is included with the assignment submission in the Canvas submission comments.
OmniTrade is built on Next.js, utilising PostgreSQL and Azure App Services.
- Frontend: Next.js 15, React 18, TailwindCSS, lucide-react icons
- Server: Node.js 20, Next.js 15, Prisma ORM
- Database: Azure Flexible Server for PostgreSQL
- Auth/Security: Coverity security scan, jsonwebtoken, bcryptjs, custom CSRF middleware
- Testing: Playwright, Jest, and React Testing Library
| GitHub Username | Name | Student ID |
|---|---|---|
| 1WrongfulGoose6 | Ashwin | 25128772 |
| PrinceAlii | Ali | 24763740 |
| Savya-Rai | Savya | 24789012 |
| AW1101 | Aston | 24955890 |
| Kaigagi | Henry | 24622983 |
| Feature ID | Feature | Description | Owner |
|---|---|---|---|
| F01 | Trade Functionality | Market/limit orders with optional stop loss and take profit. | Ashwin |
| F02 | User Registration | Account creation and profile updates (password resets, etc.). | Aston |
| F03 | User Management | Admin edit/delete/blacklist tooling for accounts. | Aston |
| F04 | Portfolio Overview | Holdings, P/L summary, and time-range performance charts. | Ali |
| F05 | Deposit & Withdrawal | Cash-in/out workflows with validation and confirmations. | Ashwin |
| F06 | Trade Backlog | Trade history views with filter/sort. | Henry |
| F08 | Market Data Display | Real-time price charts and symbol drill-downs. | Henry |
| F09 | Trade Export | Export trade and portfolio data in user-selected formats. | Henry |
| F10 | Watchlist & Alerts | Watchlists plus alert triggers and notifications. | Savya |
| F11 | News | Homepage and symbol-specific news feeds. | Savya |
| F12 | UI Design System | Consistent UI components, layouts, and navigation. | Savya |
| F13 | Market Data API Integration | Finnhub integration and backend proxy endpoints. | Ali |
| F13 | CI/CD Pipeline Setup - Azure App Services Deployments. | Ali | |
| F13 | Testing design, and environment setup. Feature testing | Ali |
├── src/
│ ├── app/ # Next.js App Router pages + API route handlers
│ ├── components/ # Front-end components (forms, charts, layout, providers)
│ ├── lib/ # Shared libraries (news, quotes, caching, user scope)
│ ├── utils/ # Auth, encryption, logger, Prisma client helpers
│ └── __tests__/ # Jest API/unit tests
├── prisma/ # Prisma schema, migrations, seed script
├── tests/ # Playwright tests
├── docs/ # Design pattern overview and diagrams
├── public/ # Static assets served by Next.js
├── scripts/ # Deployment helpers (prepare-deploy, DB URL builder, etc.)
├── test.md # Test plansOur unit tests and E2E Playwright test plans can be found in test.md
Requirements
- Node.js 20
git clone https://github.com/1WrongfulGoose6/ASD-OmniTrade.git
cd ASD-OmniTrade- Rename
.env.exampleto.env - Ensure the following keys in
.envare set (values provided in Canvas submission comments):DATABASE_URLFINNHUB_API_KEYAUTH_SECRETPII_ENCRYPTION_KEY
npm install
npx playwright install- Apply migrations:
npx prisma migrate deploy
- (Optional) Seed database:
npx prisma db seed
npm run devThe app will start on http://localhost:3000.
npm test # Jest API/unit tests
npx playwright test # Playwright tests| Name | Password | Notes | |
|---|---|---|---|
| Alice Chen | alice@example.com |
alice123 |
Has buy orders and alerts seeded |
| Ben Romero | ben@example.com |
ben123 |
Includes sell orders and pending backlog |
- API key required:
FINNHUB_API_KEY
An API key with unlimited usage (but rate limits) is provided in the Canvas submission comments. - The Finnhub API is rate-limited. To mitigate this, an in-memory cache is used (
src/lib/mcache.js).
- Subscription: Pay-as-you-go plan - includes 750 free hours per month and 30 GB of storage.
- It is unlikely that we will run out of free credits before the end of November.
- If we do, a payment card is in place, and we will coordinate with the marker before turning off the service.
docs/design-patterns.md- REST design patterns and architecture diagrams.