Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mohammadshaad/tanx.fi-assignment

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$.
https://github.com/mohammadshaad/tanx.fi-assignment

docker dockerfile golang jwt postgresql rabittmq redis sql

Last synced: about 12 hours ago
JSON representation

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$.

Awesome Lists containing this project

README

        

# 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`
```json
{
"username": "username",
"password": "password"
}
```

### Create Alert
`POST /alerts/create`
```json
{
"user_id": "1",
"coin": "BTC",
"target_price": 33000.00
}
```

### Delete Alert
`DELETE /alerts/delete`
```json
{
"user_id": "1",
"coin": "BTC"
}
```

### Fetch Alerts
`GET /alerts/fetch?user_id=1`
```json
{
"user_id": "1"
}
```

## Setup
1. Clone the repository.
2. Create a `.env` file in the root directory and add the following environment variables:
```bash
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: price_alert
```

3. Run the following command to start the application:
```bash
docker-compose up
```

4. The application will be running on `http://localhost:8000`.

## Technologies
- Golang
- PostgreSQL
- Redis
- Docker
- Binance WebSocket
- JWT

## Thank You
Made with ❤️ by [Mohammad Shaad](https://github.com/mohammadshaad).