This project is a web-based financial portfolio management app where users can fetch stock data from the Financial Modeling Prep API, manage their stock portfolios, and add comments to stocks. The app includes user authentication using Microsoft Identity, and both the frontend and backend are built with separate components.
The backend is built using ASP.NET Core and provides a REST API to handle user authentication, portfolio management, and interaction with the Financial Modeling Prep API. Follow the instructions below to set it up.
- .NET SDK
- SQL Server or any other SQL database
-
Clone the repository
git clone https://github.com/Gregapos/Finance-Project.git
-
Navigate to the
backendfolder:cd Finance-Project/backend -
Create environment-specific
appsettingsfiles:- For development, create
appsettings.Development.json. - For production, create
appsettings.Production.json.
Example
appsettings.Development.json:{ "ConnectionStrings": { "DefaultConnection": "Server={ServerName};Database=YourDatabaseName;Trusted_Connection=True;MultipleActiveResultSets=true" }, "FMPKey": "YourFMPKey", "JWT": { "Issuer": "http://localhost:5246", "Audience": "http://localhost:5246", "SigningKey": "YourSigningKey" } } - For development, create
-
Create an initial migration:
dotnet ef migrations add InitialCreate
-
Apply the migration to set up your database:
dotnet ef database update
-
Run the API:
dotnet watch run
The API will be available at http://localhost:5113 (HTTP) and https://localhost:7141 (HTTPS).
For more detailed backend setup instructions, refer to the Backend README.md.
The frontend is a React app built with TypeScript that interacts with the backend to display stock data and manage the user's portfolio.
- Node.js installed on your system
-
Navigate to the
frontendfolder:cd Finance-Project/frontend -
Install dependencies:
npm install
-
Set up environment variables:
- Copy
.env.exampleto.envand update it with your Financial Modeling Prep API key and the backend API URL.
Example
.envfile:REACT_APP_API_KEY=YourFinancialModelingPrepApiKey REACT_APP_SERVER_URL=http://localhost:5113 - Copy
-
Run the development server:
npm run start
This will start the frontend on http://localhost:3000.
To build and deploy the frontend for production, refer to the Frontend README.md.
This project is licensed under the MIT License. See the LICENSE file for details.