Skip to content

franciscofunes/portfolio-tracker

Repository files navigation

๐Ÿ’ผ Portfolio Tracker โ€“ Code Challenge

A full-stack financial portfolio tracker built with Next.js, TailwindCSS, Prisma, and PostgreSQL. Create portfolios, log trades, and visualize cumulative PnL (Profit and Loss) over time using interactive charts.


๐Ÿš€ Tech Stack

  • Frontend: Next.js (App Router), React
  • Styling/UI: TailwindCSS, ShadCN UI
  • State Management: React Hooks / Context
  • Database: PostgreSQL (via Docker)
  • ORM: Prisma
  • Charting: Recharts or Chart.js

โœ… Features

MVP

  • Portfolio Creation
    • Name, Initial Value
  • Trade Logging
    • Ticker, Entry/Exit Price, Quantity, Date
  • Dashboard View
    • Switch between portfolios
    • View all trades with PnL calculation
  • PnL Chart
    • Cumulative PnL over time (line chart)

Bonus (Optional)

  • Edit/Delete Trades
  • Responsive UI
  • Reusable components
  • TypeScript Support
  • CI-Ready Project Structure

๐Ÿ› ๏ธ Setup Instructions

๐Ÿ“ฆ Clone the Repo

git clone https://github.com/your-username/portfolio-tracker.git
cd portfolio-tracker

โš™๏ธ Configure PostgreSQL with Docker (WSL-Friendly)

Make sure Docker is installed and running. Then start the PostgreSQL container:

docker-compose up -d

The repository includes a preconfigured docker-compose.yml, so there's no need to create one manually.


๐Ÿ”Œ Prisma ORM Setup

1. Install Dependencies

Choose your preferred package manager:

Using pnpm (recommended)

pnpm install

Using npm

npm install

Using yarn

yarn install

2. Run Database Migrations

This will create the tables in your local PostgreSQL instance based on the Prisma schema.

npx prisma migrate dev --name init

3. Seed the Database (Optional)

If a prisma/seed.ts file is provided, you can populate your database with sample data by running:

npx prisma db seed

This will run the seeding script and insert sample portfolios and trades into the database.


4. Start the Development Server

To start the development server, run:

pnpm run dev

This will start the Next.js development server and you can access the application in your browser at http://localhost:3000.

About

๐Ÿ’ผ Code Challenge โ€“ A full-stack financial portfolio tracker built with Next.js, TailwindCSS, Prisma, and PostgreSQL. Create portfolios, log trades, and visualize cumulative PnL over time with interactive charts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก