Skip to content

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Vision CodeCrafter 2.0

Project overview

Vision CodeCrafter 2.0 is a full-stack finance / investing dashboard that combines a modern React UI with a Node/Express API and a PostgreSQL database.

What you can do

  • Sign up / log in with cookie-based JWT authentication
  • Access role-based dashboards (User vs Admin)
  • View stock-related screens (including stock symbol detail pages)
  • Perform buy/sell transactions that update balance and create transaction history records
  • View estimated profits based on your transactions vs current asset prices
  • Generate and download an Investment Report PDF for a user
  • Fetch intraday stock data via an API proxy to Alpha Vantage

A full-stack finance / investing dashboard application:

  • Client: React (Vite) + Redux Toolkit + redux-persist + Tailwind
  • Server: Node.js + Express
  • Database: PostgreSQL
  • Auth: JWT stored in an HTTP-only cookie
  • Integrations: Alpha Vantage stock intraday data
  • Extras: Generates an Investment Report PDF

Live site (as configured in repo metadata): https://vision-codecrafter20.vercel.app


Monorepo layout

  • client/ — React app (Vite)
  • server/ — Express API

Prerequisites

  • Node.js (LTS recommended)
  • npm
  • PostgreSQL database

Setup

1) Install dependencies

# Frontend
cd client
npm install

# Backend
cd ../server
npm install

2) Environment variables

Server (server/.env)

Create server/.env with at least:

# Auth
JWT_SECRET=your_secret

# Alpha Vantage
ALPHA_VANTAGE_API_KEY=your_api_key

# Postgres connection
PGHOST=...
PGPORT=5432
PGDATABASE=...
PGUSER=...
PGPASSWORD=...

Client (client/.env)

Configure your API base URL if your client code expects it (check client/.env in this repo).


Run locally

Start the backend

cd server
node server.js
# Server runs on http://localhost:3000

Start the frontend

cd client
npm run dev
# Vite dev server typically runs on http://localhost:5173

API overview (server)

Base URL: http://localhost:3000

User & Auth — /api/user

  • POST /api/user/register
  • POST /api/user/login (sets jwttoken cookie)
  • POST /api/user/logout
  • PUT /api/user/update/:user_id (JWT protected)
  • DELETE /api/user/delete/:user_id (JWT protected)
  • PUT /api/user/balance

Trading & profit estimates — /api/price

  • POST /api/price/buy — records BUY transaction and decreases balance
  • POST /api/price/sell — records SELL transaction and increases balance
  • GET /api/price/profits/:userId — estimated profit per asset

Investment report PDF — /api/investments

  • GET /api/investments/generate-pdf?user_id=... — downloads a PDF report

Stock data — /api/stock

  • GET /api/stock/:symbol — proxies Alpha Vantage intraday data

Frontend routes (client)

Public:

  • / landing
  • /login, /signup
  • /dashboard

User (role-based protected):

  • /userdetails
  • /stock, /stock/:stockSymbol
  • /mutualfunds, /bonds, /insurance, /explore

Admin (role-based protected):

  • /admin/dashboard
  • /admin/user
  • /admin/details

Notes / known issues

These are based on the current codebase:

  • server/routes/assetRoutes.js exists (CRUD) but is not mounted in server/server.js, so those endpoints are not reachable unless you add app.use('/api/assets', assetRoutes).
  • In server/controllers/userscontroller.js, updateUser reads req.params.id but the route is defined as :user_id.
  • server/models/investmetModel.js calls pool.query(...), but server/config/db.js exports { query }.

License

No license file is currently included. Add a LICENSE and update this section.

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages