By default, the backend is configured to allow requests only from the deployed frontend (https://value-glance-frontend.vercel.app) and from any local localhost domains.
If you want to modify the CORS policy to allow requests from other domains, you can update the CORS configuration in the backend code.
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name -
Create a
.envfile and add the following environment variables:DATABASE_URL=your-database-url API_KEY=your-api-key
Get your free API key at Financial Modeling Prep
-
Install backend dependencies:
pip install -r requirements.txt
-
Run the backend:
python app.py
or
flask run
- URL:
/get_income-statement - Method:
GET - Description: Retrieve the latest financial data.
- URL:
/filter - Method:
GET - Query Parameters:
dateRange.start: Start yeardateRange.end: End yearrevenue.min: Minimum revenuerevenue.max: Maximum revenuenetIncome.min: Minimum net incomenetIncome.max: Maximum net incomesortBy: Sort by field (date,revenue,netIncome)order: Sort order (ascordesc)
The project uses PostgreSQL as the database. To run the backend locally, you need to configure the database connection.
- Install PostgreSQL and create a database.
- Update the
DATABASE_URLin the.envfile to point to your own database.