B3Notifier is a platform designed for investors on the B3 (Brazilian Stock Exchange), providing timely alerts, monitoring market quotes, and sending emails for promising buy or sell opportunities. With a Django backend (including Celery and Redis for asynchronous tasks and scheduling) and a React Vite frontend.
-
Clone the repository (if you haven't already):
git clone https://github.com/lfelipediniz/B3Notifier.git cd B3Notifier -
Create and activate a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate -
Install Python dependencies:
pip install -r backend/requirements.txt
-
Make sure you have a Redis server running locally or in the cloud. Update the broker information in your
.envfile (see Environment Variables) if needed.
-
From the root folder, navigate to the
frontenddirectory:cd frontend -
Install dependencies using pnpm:
pnpm install
-
Make migrations:
python manage.py makemigrations
-
Apply migrations:
python manage.py migrate
-
Start the Django server:
python manage.py runserver
by default, the server will be available at
http://127.0.0.1:8000
To handle asynchronous tasks (such as sending emails and scheduled alerts), you need to run a Celery worker and a Celery beat scheduler:
- Start the Celery worker:
celery -A backend worker -l INFO
- Start the Celery beat scheduler (for periodic tasks):
celery -A backend beat -l INFO
- Start the development server:
by default, the React Vite app will run at
pnpm dev
http://127.0.0.1:5173.
Create a .env file in the backend directory with the following variables (adjust values as needed):
# Django Config
SECRET_KEY="create_your_secret_key" # jwt
DEBUG=True
DJANGO_SECRET_KEY="create_your_secret_key" # django
CELERY_BROKER_URL="redis://localhost:6379/0" # or your cloud redis url
CELERY_RESULT_BACKEND="redis://localhost:6379/0" # or your cloud redis url
DB_ENGINE="django.db.backends.sqlite3"
DB_NAME="db.sqlite3"
# JWT config - user token
ACCESS_TOKEN_LIFETIME=60 # minutos
REFRESH_TOKEN_LIFETIME=1440 # minutos
# CORS config # IMPORTANT!
CORS_ALLOW_ALL_ORIGINS=True
CORS_ALLOW_CREDENTIALS=True
RESEND_API_KEY=your_resend_key
Create .env in the frontend directory with the following variables (adjust values as needed):
VITE_API_BASE_URL=http://127.0.0.1:8000/api # or your cloud api key
Happy Trading! 🚀