|
1 |
| -# Stock Portfolio Tracker |
| 1 | +# Stock Portfolio Tracker 📈 |
2 | 2 |
|
3 |
| -A modern web application for tracking your stock portfolio and watchlist. Built with React, Node.js, and PostgreSQL. |
| 3 | +<div align="center"> |
4 | 4 |
|
5 |
| -## 🌐 Live Demo |
| 5 | +[](https://portfolio-tracker-hackstyx.vercel.app) |
| 6 | +[](https://portfolio-tracker-backend-y7ne.onrender.com/api) |
| 7 | +[](https://reactjs.org/) |
| 8 | +[](https://vitejs.dev/) |
| 9 | +[](https://www.mysql.com/) |
| 10 | +[](https://tailwindcss.com/) |
| 11 | +[](https://nodejs.org/) |
6 | 12 |
|
7 |
| -- Frontend: [https://portfolio-tracker-hackstyx.vercel.app](https://portfolio-tracker-hackstyx.vercel.app) |
8 |
| -- Backend API: [https://portfolio-tracker-backend-y7ne.onrender.com/api](https://portfolio-tracker-backend-y7ne.onrender.com/api) |
| 13 | +<p align="center"> |
| 14 | + <strong>A modern, responsive stock portfolio tracker built with React and Node.js</strong> |
| 15 | +</p> |
| 16 | + |
| 17 | +[Live Demo](https://portfolio-tracker-hackstyx.vercel.app) • [API Endpoint](https://portfolio-tracker-backend-y7ne.onrender.com/api) • [Report Bug](https://github.com/HackStyx/portfolio-tracker/issues) |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +</div> |
9 | 22 |
|
10 | 23 | ## ✨ Features
|
11 | 24 |
|
12 |
| -- 📊 Real-time stock portfolio tracking |
13 |
| -- 👀 Watchlist management |
14 |
| -- 📈 Stock price history visualization |
15 |
| -- 🌓 Dark/Light theme support |
16 |
| -- 📱 Responsive design |
17 |
| -- 🔄 Automatic price updates |
| 25 | +- 📊 **Portfolio Management** - Track your stocks with real-time updates |
| 26 | +- 👀 **Watchlist** - Monitor potential investments |
| 27 | +- 🌓 **Dark/Light Mode** - Easy on the eyes, day and night |
| 28 | +- 📱 **Fully Responsive** - Perfect on desktop and mobile |
| 29 | +- 🔄 **Live Updates** - Stock prices update automatically |
| 30 | +- 📈 **Price History** - Visualize stock performance |
18 | 31 |
|
19 |
| -## 🚀 Running Locally |
| 32 | +## 🚀 Quick Start |
20 | 33 |
|
21 | 34 | ### Prerequisites
|
22 | 35 |
|
23 |
| -- Node.js (v14 or higher) |
| 36 | +- Node.js 14+ |
24 | 37 | - npm or yarn
|
25 |
| -- PostgreSQL database |
| 38 | +- MySQL |
26 | 39 |
|
27 | 40 | ### Frontend Setup
|
28 | 41 |
|
29 |
| -1. Clone the repository: |
| 42 | +1. Clone and install: |
30 | 43 | ```bash
|
31 | 44 | git clone https://github.com/HackStyx/portfolio-tracker.git
|
32 | 45 | cd portfolio-tracker
|
33 |
| -``` |
34 |
| - |
35 |
| -2. Install dependencies: |
36 |
| -```bash |
37 | 46 | npm install
|
38 |
| -# or |
39 |
| -yarn install |
40 | 47 | ```
|
41 | 48 |
|
42 |
| -3. Create a `.env` file in the root directory: |
| 49 | +2. Create `.env`: |
43 | 50 | ```env
|
44 | 51 | VITE_API_BASE_URL=http://localhost:5000/api
|
45 | 52 | ```
|
46 | 53 |
|
47 |
| -4. Start the development server: |
| 54 | +3. Start development server: |
48 | 55 | ```bash
|
49 | 56 | npm run dev
|
50 |
| -# or |
51 |
| -yarn dev |
52 | 57 | ```
|
53 | 58 |
|
54 |
| -The frontend will be available at `http://localhost:5173` |
55 |
| - |
56 | 59 | ### Backend Setup
|
57 | 60 |
|
58 |
| -1. Navigate to the backend directory: |
| 61 | +1. Setup backend: |
59 | 62 | ```bash
|
60 | 63 | cd backend
|
61 |
| -``` |
62 |
| - |
63 |
| -2. Install dependencies: |
64 |
| -```bash |
65 | 64 | npm install
|
66 |
| -# or |
67 |
| -yarn install |
68 | 65 | ```
|
69 | 66 |
|
70 |
| -3. Create a `.env` file in the backend directory: |
| 67 | +2. Configure `.env`: |
71 | 68 | ```env
|
72 |
| -DATABASE_URL=your_postgresql_connection_string |
| 69 | +DATABASE_URL=mysql://user:password@localhost:3306/portfolio_tracker |
73 | 70 | PORT=5000
|
74 | 71 | NODE_ENV=development
|
75 | 72 | ```
|
76 | 73 |
|
77 |
| -4. Run database migrations: |
| 74 | +3. Run migrations and start: |
78 | 75 | ```bash
|
79 | 76 | npm run migrate
|
80 |
| -# or |
81 |
| -yarn migrate |
82 |
| -``` |
83 |
| - |
84 |
| -5. Start the backend server: |
85 |
| -```bash |
86 | 77 | npm start
|
87 |
| -# or |
88 |
| -yarn start |
89 | 78 | ```
|
90 | 79 |
|
91 |
| -The API will be available at `http://localhost:5000/api` |
92 |
| - |
93 |
| -## 🔧 Environment Variables |
94 |
| - |
95 |
| -### Frontend (.env) |
96 |
| -- `VITE_API_BASE_URL`: Backend API URL |
97 |
| - |
98 |
| -### Backend (.env) |
99 |
| -- `DATABASE_URL`: PostgreSQL connection string |
100 |
| -- `PORT`: Server port (default: 5000) |
101 |
| -- `NODE_ENV`: Environment (development/production) |
102 |
| - |
103 |
| -## 📝 API Documentation |
104 |
| - |
105 |
| -### Endpoints |
106 |
| - |
107 |
| -#### Stocks |
108 |
| -- `GET /api/stocks` - Get all stocks in portfolio |
109 |
| -- `POST /api/stocks` - Add a new stock |
110 |
| -- `PUT /api/stocks/:id` - Update a stock |
111 |
| -- `DELETE /api/stocks/:id` - Delete a stock |
112 |
| -- `GET /api/stocks/:ticker/historical` - Get historical data |
113 |
| - |
114 |
| -#### Watchlist |
115 |
| -- `GET /api/watchlist` - Get watchlist |
116 |
| -- `POST /api/watchlist` - Add to watchlist |
117 |
| -- `PUT /api/watchlist/:id` - Update watchlist item |
118 |
| -- `DELETE /api/watchlist/:id` - Remove from watchlist |
119 |
| -- `POST /api/watchlist/sync-portfolio` - Sync with portfolio |
120 |
| - |
121 |
| -## ⚠️ Assumptions & Limitations |
122 |
| - |
123 |
| -1. **Stock Data** |
124 |
| - - Uses simulated stock data for demonstration |
125 |
| - - Real-time price updates are simulated |
126 |
| - - Historical data is generated for demonstration |
127 |
| - |
128 |
| -2. **Authentication** |
129 |
| - - Currently uses a simple reset-based logout |
130 |
| - - No user authentication system |
131 |
| - - Single user environment |
132 |
| - |
133 |
| -3. **Performance** |
134 |
| - - Limited to managing reasonable portfolio sizes |
135 |
| - - Price updates every minute |
136 |
| - - Historical data limited to recent periods |
137 |
| - |
138 |
| -4. **Browser Support** |
139 |
| - - Requires modern browsers |
140 |
| - - Best experienced on Chrome, Firefox, Safari |
141 |
| - - Requires JavaScript enabled |
142 |
| - |
143 |
| -## 🛠️ Tech Stack |
144 |
| - |
145 |
| -- **Frontend** |
146 |
| - - React |
147 |
| - - Vite |
148 |
| - - TailwindCSS |
149 |
| - - Framer Motion |
150 |
| - - Tremor |
151 |
| - - Axios |
152 |
| - |
153 |
| -- **Backend** |
154 |
| - - Node.js |
155 |
| - - Express |
156 |
| - - PostgreSQL |
157 |
| - - Knex.js |
158 |
| - - Node-Postgres |
159 |
| - |
160 |
| -## 📱 Responsive Design |
161 |
| - |
162 |
| -- Fully responsive layout |
163 |
| -- Mobile-first approach |
164 |
| -- Adaptive UI components |
165 |
| -- Touch-friendly interactions |
166 |
| - |
167 |
| -## 🤝 Contributing |
168 |
| - |
169 |
| -1. Fork the repository |
170 |
| -2. Create your feature branch (`git checkout -b feature/AmazingFeature`) |
171 |
| -3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) |
172 |
| -4. Push to the branch (`git push origin feature/AmazingFeature`) |
173 |
| -5. Open a Pull Request |
| 80 | +## 🔌 API Endpoints |
| 81 | + |
| 82 | +### Portfolio |
| 83 | +\`\`\`http |
| 84 | +GET /api/stocks # Get portfolio stocks |
| 85 | +POST /api/stocks # Add stock |
| 86 | +PUT /api/stocks/:id # Update stock |
| 87 | +DELETE /api/stocks/:id # Remove stock |
| 88 | +\`\`\` |
| 89 | + |
| 90 | +### Watchlist |
| 91 | +\`\`\`http |
| 92 | +GET /api/watchlist # Get watchlist |
| 93 | +POST /api/watchlist # Add to watchlist |
| 94 | +PUT /api/watchlist/:id # Update watchlist item |
| 95 | +DELETE /api/watchlist/:id # Remove from watchlist |
| 96 | +\`\`\` |
| 97 | + |
| 98 | +## ⚡️ Tech Stack |
| 99 | + |
| 100 | +### Frontend |
| 101 | +- React + Vite |
| 102 | +- TailwindCSS |
| 103 | +- Framer Motion |
| 104 | +- Tremor Charts |
| 105 | +- Axios |
| 106 | + |
| 107 | +### Backend |
| 108 | +- Node.js |
| 109 | +- Express |
| 110 | +- MySQL |
| 111 | +- Knex.js |
| 112 | + |
| 113 | +## ⚠️ Limitations |
| 114 | + |
| 115 | +- Uses simulated stock data |
| 116 | +- Single-user environment |
| 117 | +- Price updates every minute |
| 118 | +- Best viewed in modern browsers |
174 | 119 |
|
175 | 120 | ## 📄 License
|
176 | 121 |
|
177 |
| -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 122 | +MIT © [HackStyx](LICENSE) |
0 commit comments