StockSim is a full-stack stock simulation application that allows users to simulate buying and selling stocks, view current stock prices, get the latest news, and manage a virtual wallet. The project is built with a React frontend and an Express backend.
- User Authentication: Secure login and signup functionality.
- Dashboard: View portfolio, total investment, current value, and profit/loss.
- Stock Management: Buy and sell stocks, view transaction history.
- Latest News: Fetch and display the latest news related to stocks.
- Virtual Wallet: Manage virtual money, view wallet balance and profit/loss, reset wallet, and account.
- Portfolio Summary: Displays invested amount, current value, total profit/loss in both money and percentage.
- Frontend: React, React Router, React Toastify, Axios
- Backend: Node.js, Express, MongoDB
- Styling: CSS
- API: Finnhub, Yahoo Finance, Google Finance
-
Clone the repository:
git clone https://github.com/Kuzma02/stock-app.git cd stock-app
-
Install dependencies:
npm install cd client npm install cd ..
-
Create a
.env
file in the root directory and add the following:PORT=3000 MONGO_URI=<your_mongodb_connection_string> JWT_SECRET=<your_jwt_secret>
-
Start the application:
npm run start
- Login/Register: Access the login or register page to authenticate yourself.
- Dashboard: Once logged in, you will be redirected to the dashboard.
- View your portfolio summary, including the invested amount, current value, and total profit/loss.
- Use the form to add new stocks to your portfolio.
- Fetch the latest stock news by clicking the "Latest News" button.
- View your transaction history and manage your virtual wallet.
- Manage Stocks:
- Add stocks to your portfolio by specifying the stock symbol, purchase date, and quantity.
- Sell stocks from your portfolio and view the updated profit/loss.
- Virtual Wallet:
- View your current wallet balance and profit/loss.
- Reset your wallet or account using the respective buttons in the navbar.
- Frontend: Located in the
client
directory.- Components: All React components.
- Styles: CSS files for styling the components.
- Helpers: Functions to handle API requests and data processing.
- Backend: Located in the root directory.
- Routes: Express routes for handling API requests.
- Controllers: Functions to handle the logic for each route.
- Models: Mongoose models for MongoDB collections.
Feel free to contribute to the project by opening a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.