Welcome to the Stock Analyzer project! Follow the steps below to set up the project locally and start contributing or testing.
Make sure you have the following installed on your system:
- Python 3.11.+
- Node.js and npm
- Git
Directory structure:
└── srigadaakshaykumar-stock/
├── LICENSE
├── README.md
├── SETUP.md
├── CONTRIBUTION.md
├── CODE_OF_CONDUCT.md
├── SECURITY.md
├── package-lock.json
├── package.json
├── static.json
├── backend/
├──app/
├──data/
│ ├── app.py
| ├── generate_csvs.py
│ ├── requirements.txt
│ ├── stock-prediction.ipynb
│ └── tf.keras
├── public/
| ├── icon.png
│ ├── index.html
│ ├── manifest.json
│ └── robots.txt
└── src/
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── reportWebVitals.js
├── setupTests.js
└── components/
├── About.jsx
├── AuthContext.jsx
├── BackToTopBtn.jsx
├── ContactForm.jsx
├── firebase.js
├── Footer.css
├── Footer.jsx
├── Header.jsx
├── Login.css
├── Login.js
├── Prediction.jsx
├── SentimentChart.jsx
├── SignUp.css
├── Signup.jsx
├── Stockdata.jsx
├── StockMetricCard.jsx
├── StockList.jsx
└── data/
└── stockData.json
-
Fork the repository Fork the project to your github account
-
Clone the repository
git clone https://github.com/yourusername/stock.gitNavigate to backend folder
cd stock/backend- Create a Virtual Environemnt
python -m venv venv
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # WindowsNote: run python --version before creating a virtual environment. The modules in requirement.txt are compatible with <=3.11 version of python.
If you're using higher versions, consider creating the virtual environement in the following way:
python -3.11 -m venv venvVisit official website of python to download version 3.11.*
- Install dependencies
pip install -r requirements.txt- Start the backend server
python app.pyThe app will be available at http://x.x.x.x:10000. (you will find the correct url in the server console) copy the server url to use in frontend make sure the app in the testing during the code editing
Change the following:
app = Flask(__name__)
CORS(app, ....)to
app = Flask(__name__)
CORS(app)for testing environment
Install dependencies
npm installAdd server url to frontend Stockdata.jsx and Predict.jsx page
from
${process.env.REACT_APP_API_URL}to
http://x.x.x.x:10000 REACT_APP_FIREBASE_API_KEY="xxxx(you credentials)"
REACT_APP_FIREBASE_AUTH_DOMAIN="xxxx(you credentials)"
REACT_APP_FIREBASE_DATABASE_URL="xxxx(you credentials)"
REACT_APP_FIREBASE_PROJECT_ID="xxxx(you credentials)"
REACT_APP_FIREBASE_STORAGE_BUCKET="xxxx(you credentials)"
REACT_APP_FIREBASE_MESSAGING_SENDER_ID="xxxx(you credentials)"
REACT_APP_FIREBASE_APP_ID="xxxx(you credentials)"
REACT_APP_FIREBASE_MEASUREMENT_ID="xxxx(you credentials)"-
Go to Firebase Console
-
Create a Project (or use existing)
- Click Add Project → enter a name (e.g., Stock Analyzer).
- Configure Google Analytics (optional).
- Project will take a few seconds to be ready.
-
Register a Web App
- Inside your project → go to Project Overview (top-left) → Add app → choose Web (</> icon).
- Give your app a nickname (e.g., stock-analyzer-web).
- Click Register App.
-
Get Firebase Config Object
- After registering, Firebase shows you code like this:
const firebaseConfig = { apiKey: "AIzaSyDxxxxxx", authDomain: "your-project-id.firebaseapp.com", databaseURL: "https://your-project-id.firebaseio.com", projectId: "your-project-id", storageBucket: "your-project-id.appspot.com", messagingSenderId: "123456789", appId: "1:123456789:web:abcdef123456", measurementId: "G-ABC123XYZ"
};
These values map 1:1 to the `.env` variables.
5. Copy them into `.env`
## Start the project
```bash
npm start
The app will be available at http://localhost:3000.