Skip to content

lfelipediniz/B3Notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

B3Notifier

B3Notifier Logo

A system designed to assist investors in the Brazilian stock exchange (B3) by tracking stock quotes, sending custom alerts, and notifying users via email whenever promising buy or sell opportunities arise!

Table of Contents

  1. Introduction
  2. Requirements
    1. Backend
    2. Frontend
  3. Installation
    1. Backend (Django + Celery + Redis)
    2. Frontend (React Vite)
  4. How to Use
    1. Running in the Backend Folder
    2. Running Celery
    3. Running in the Frontend Folder
  5. Environment Variables

Introduction

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.

Requirements

Backend

Frontend

Installation

Backend (Django + Celery + Redis)

  1. Clone the repository (if you haven't already):

    git clone https://github.com/lfelipediniz/B3Notifier.git
    cd B3Notifier
  2. Create and activate a virtual environment (recommended):

    python3 -m venv venv
    source venv/bin/activate     
  3. Install Python dependencies:

    pip install -r backend/requirements.txt
  4. Make sure you have a Redis server running locally or in the cloud. Update the broker information in your .env file (see Environment Variables) if needed.

Frontend (React Vite)

  1. From the root folder, navigate to the frontend directory:

    cd frontend
  2. Install dependencies using pnpm:

    pnpm install

How to Use

Running in the Backend Folder

  1. Make migrations:

    python manage.py makemigrations
  2. Apply migrations:

    python manage.py migrate
  3. Start the Django server:

    python manage.py runserver

    by default, the server will be available at http://127.0.0.1:8000

Running Celery

To handle asynchronous tasks (such as sending emails and scheduled alerts), you need to run a Celery worker and a Celery beat scheduler:

  1. Start the Celery worker:
    celery -A backend worker -l INFO
  2. Start the Celery beat scheduler (for periodic tasks):
    celery -A backend beat -l INFO

Running in the Frontend Folder

  1. Start the development server:
    pnpm dev
    by default, the React Vite app will run at http://127.0.0.1:5173.

Environment Variables

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! 🚀

About

Tracks B3 stocks and alerts users to buy/sell opportunities!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published