Skip to content

A price alert application that triggers an email when the user’s target price is Achieved. Say, the current price of BTC is $28,000, a user sets an alert for BTC at a price of 33,000$. The application should send an email to the user when the price of BTC reaches 33,000$.

Notifications You must be signed in to change notification settings

mohammadshaad/golang-btc-price-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Price Alert Application

Overview

This application allows users to set price alerts for Bitcoin (BTC). When the target price is reached, an email notification is sent to the user.

Features

  • Create, delete, and fetch price alerts.
  • Real-time price updates using Binance WebSocket.
  • User authentication with JWT tokens.
  • Email notifications using Gmail SMTP.
  • Caching with Redis.
  • Dockerized setup.

Endpoints

Login

POST /login

{
    "username": "username",
    "password": "password"
}

Create Alert

POST /alerts/create

{
    "user_id": "1",
    "coin": "BTC",
    "target_price": 33000.00
}

Delete Alert

DELETE /alerts/delete

{
    "user_id": "1",
    "coin": "BTC"
}

Fetch Alerts

GET /alerts/fetch?user_id=1

{
    "user_id": "1"
}

Setup

  1. Clone the repository.
  2. Create a .env file in the root directory and add the following environment variables:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: price_alert
  1. Run the following command to start the application:
docker-compose up
  1. The application will be running on http://localhost:8000.

Technologies

  • Golang
  • PostgreSQL
  • Redis
  • Docker
  • Binance WebSocket
  • JWT

Thank You

Made with ❤️ by Mohammad Shaad.

About

A price alert application that triggers an email when the user’s target price is Achieved. Say, the current price of BTC is $28,000, a user sets an alert for BTC at a price of 33,000$. The application should send an email to the user when the price of BTC reaches 33,000$.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published