A modern, full-stack stock analysis and portfolio management platform focused on the Pakistan Stock Exchange (PSX). Built with the MERN stack and designed for progressive AI integration.
PakStocks enables users to:
- Track live PSX market data
- Manage watchlists and portfolios
- Set smart price alerts
- Analyze performance visually
- Prepare for AI-powered insights and recommendations
- React (Vite)
- React Router
- React Query
- Tailwind CSS + shadcn/ui
- Framer Motion
- Recharts
- Google OAuth
- Node.js + Express
- MongoDB (Mongoose)
- Zod (validation)
- Axios + Cheerio (web scraping)
- Google OAuth (auth)
root/
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── lib/
│ │ ├── App.jsx
│ │ └── main.jsx
│
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── services/
│ ├── middlewares/
│ ├── validators/
│ └── app.js
- Google OAuth login
- Automatic user creation
- Session stored in frontend (localStorage)
- Live stock prices (PSX scraping)
- Indices (KSE, KMI30, etc.)
- Add/remove stocks
- Personalized tracking
- Buy/Sell transactions
- Real-time valuation
- Profit/Loss calculations
- Oversell protection logic
- Set price targets (above/below)
- Auto-trigger based on live prices
- Browser notifications + sound alerts
- Mark alerts as seen
-
Responsive dashboard UI
-
Smooth animations (Framer Motion)
-
Dark mode support
-
Real-time feel via polling
-
Charts:
- Pie chart (allocation)
- Sparkline trends
- Clean MVC structure
- Zod validation for safety
- Centralized error handling
- Async middleware wrapper
- Efficient alert checking (single price fetch)
POST /api/auth/google
GET /api/indices
GET /api/stockvalues
GET /api/watchlist
POST /api/watchlist
DELETE /api/watchlist/:id
GET /api/portfolio
POST /api/portfolio
DELETE /api/portfolio/symbol/:symbol
POST /api/alerts
GET /api/alerts
GET /api/alerts/check
PUT /api/alerts/mark-seen
DELETE /api/alerts/:id
git clone <repo-url>
cd pakstockscd backend
npm installCreate .env:
PORT=5000
MONGO_URI=your_mongo_uri
GOOGLE_CLIENT_ID=your_google_client_idRun:
npm run devcd frontend
npm installCreate .env:
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_API_BASE_URL=http://localhost:5000/apiRun:
npm run dev- Stock recommendations (based on user portfolio + watchlist)
- Portfolio insights (sector analysis, risk detection)
- Smart alerts (prediction-based)
- AI chatbot assistant
GET /
Mubeen Channa - MERN Stack Dev