Skip to content
Merged

Dev #30

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: oheyek
buy_me_a_coffee: ohey
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
target-branch: "dev"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
groups:
all-python-deps:
patterns:
- "*"
69 changes: 69 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI/CD

on:
push:
branches: [main]
paths-ignore:
- "requirements.txt"
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
run-tests:
uses: ./.github/workflows/tests.yml

build-docs:
needs: run-tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Doxygen & Graphviz
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz

- name: Generate documentation
run: doxygen Doxyfile

- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/html

deploy-docs:
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4

build-docker:
needs: build-docs
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAME: oheyek/coin-cast
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin

- name: Build Docker image
run: |
docker build -t $IMAGE_NAME:latest .

- name: Push Docker image
run: |
docker push $IMAGE_NAME:latest
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

on:
pull_request:
branches: [dev]
workflow_call:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install UV
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- name: Install dependencies & test tools
run: |
uv run pip install -r requirements.txt
uv run pip install pytest

- name: Run tests
run: uv run pytest src/tests/ -v --tb=short
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
173 changes: 173 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# <img src="static/img/icon-doxygen.png" alt="CoinCast Logo" width="32"/> CoinCast

![Python Version](https://img.shields.io/badge/python-3.14%2B-blue?logo=python&logoColor=white)
[![License](https://img.shields.io/github/license/oheyek/CoinCast?color=green)](LICENSE)
![Platform](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-lightgrey)
[![Docker Pulls](https://img.shields.io/docker/pulls/oheyek/coin-cast)](https://hub.docker.com/r/oheyek/coin-cast)
[![Documentation](https://img.shields.io/badge/docs-github.io-blue)](https://oheyek.github.io/CoinCast/)

A powerful web application for cryptocurrency price forecasting with an intuitive interface.

## ✨ Features

- **Multi-Crypto Support**: Fetch and analyze prices for various cryptocurrencies.
- **Real-Time Data Fetching**: Get up-to-date cryptocurrency prices instantly.
- **Price Predictions**: Predict future price trends using advanced algorithms.
- **Web-Based Interface**: Accessible from any device with a browser.
- **Linear Regression Predictions**: Predict future price trends using linear regression models.
- **Simple and Fast**: Analyze crypto data in the blink of an eye.
- **Cross-Platform**: Works seamlessly on Windows, macOS, and Linux.
- **Containerized**: Available as a Docker image for easy deployment.
- **Comprehensive Testing**: Thoroughly tested for reliability.

## 🛠️ Installation

### Using Docker (Recommended)

1. Pull the Docker image:
```bash
docker pull oheyek/coin-cast
```
2. Run the container:
```bash
docker run -p 5000:5000 oheyek/coin-cast
```
3. Open your browser and go to `http://localhost:5000`

### Running from Source

```bash
# Clone the repository
git clone https://github.com/oheyek/CoinCast.git
cd CoinCast

# Install dependencies
pip install -r requirements.txt

# Run the application
python app.py
```

## 🎯 Usage

1. Open the application in your browser (locally only).
2. Select a cryptocurrency to analyze.
3. View real-time prices and predictions.
4. Explore forecast trends instantly.

## 📋 Supported Cryptocurrencies

| Category | Cryptocurrencies Available |
| ------------ | ----------------------------------- |
| **Major** | Bitcoin (BTC), Ethereum (ETH), etc. |
| **Altcoins** | Litecoin (LTC), Ripple (XRP), etc. |

## ⚠️ Disclaimer

This project is for educational and portfolio purposes only. It is not intended as financial or investment advice. Cryptocurrency investments are highly volatile and risky. Always do your own research and consult with a financial advisor before making investment decisions.

## 🔧 Technical Details

- **Language**: Python 3.14+
- **Web Framework**: Flask 3.1.2+
- **WSGI Server**: Gunicorn 23.0.0+
- **Testing**: pytest 9.0.2+
- **Deployment**: Docker

### Key Dependencies

```
flask>=3.1.2
gunicorn>=23.0.0
pytest>=9.0.2
```

## 🏗️ Building from Source

### Docker Build

```bash
# Build the Docker image
docker build -t coin-cast .

# Run the container
docker run -p 5000:5000 coin-cast
```

## 🗂️ Project Structure

```
CoinCast/
├── app.py # Flask application entry point
├── src/
│ ├── __init__.py
│ ├── fetch_crypto.py # Crypto data fetching logic
│ ├── predict.py # Prediction algorithms
│ └── tests/
│ ├── __init__.py
│ ├── test_fetch_crypto.py # Fetching tests
│ └── test_predict.py # Prediction tests
├── static/
│ ├── css/
│ │ └── style.css # Stylesheets
│ └── img/
│ ├── icon-doxygen.png
│ ├── icon.ico
│ └── icon.png # Icons
├── templates/
│ ├── base.html # Base template
│ └── index.html # Home page
├── pyproject.toml # Project configuration
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── LICENSE # MIT License
└── README.md # This file
```

## 🧪 Testing

The project includes simple unit tests for all fetching and prediction functions.

### Running Tests

```bash
# Install test dependencies
pip install pytest

# Run all tests
pytest

# Run specific test file
pytest tests/test_fetch_crypto.py

# Run with verbose output
pytest -v
```

## 🤝 Contributions

Contributions are welcome! Here's how you can help:

1. Fork the repository
2. Create a new feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is open-source and available under the [MIT License](LICENSE).

---

**Happy Forecasting! 🎉**

## Author

Made with ❤️ by ohey<br>
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/black_img.png)](https://www.buymeacoffee.com/ohey)

---

Due to the short limit of the free API, the site is not deployed as it can even get data once. If you find this project useful, consider buying me a coffee! ☕

2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def main() -> str:


if __name__ == "__main__":
app.run(debug=True)
app.run(debug=False)
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[project]
name = "coincast"
version = "0.1.0"
description = "Add your description here"
version = "1.0.0"
description = "An interactive crypto price analysis tool built in Python, featuring historical data visualization and short-term price forecasting. The project is fully containerized and deployed via automated cloud infrastructure."
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"cachetools>=6.2.4",
"flask>=3.1.2",
"gunicorn>=23.0.0",
"numpy>=2.4.0",
"pytest>=9.0.2",
"requests>=2.32.5",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ certifi==2026.1.4
charset-normalizer==3.4.4
click==8.3.1
flask==3.1.2
gunicorn==23.0.0
idna==3.11
iniconfig==2.3.0
itsdangerous==2.2.0
Expand Down