Giter Site home page Giter Site logo

cenaashoori / cryptbee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anshumannandan/cryptbee

1.0 0.0 0.0 1.31 MB

Backend of a dummy cryptocurrency trading app. On this platform, you can buy, sell, and study data of cryptocurrencies.

Home Page: https://cryptbee.anshumannandan.tech/admin/

Shell 0.28% Python 96.99% HTML 2.49% Dockerfile 0.24%

cryptbee's Introduction

cryptBEE

cryptBEE is a dummy trading crypto app made using Flutter for the frontend and Django for the backend. This repository contains the code for the backend part of the app. The frontend repository can be found here.

Key Features

CryptBEE offers essential features for cryptocurrency enthusiasts:

  • Email (SMTP) for Signup/Signin.
  • Two-Factor Authentication (2FA) with Enable/Disable through Phone Number utilizing Twilio.
  • JWT Authentication with Refresh and Access tokens.
  • Real-time WebSockets for updates.
  • Fetching real time cryptocurrency data through WebScrapping & 3rd party endpoints.
  • WebScrapping real time crypto NEWS.
  • Buy, Sell, Transaction History.
  • Dynamic Profit/Loss Calculator.
  • Celery and Celerybeat for background tasking such as Sending Emails, SMS, Updating Coins information and NEWS in database.
  • Deployment on AWS EC2 instance.
  • Dockerized all the services (Backend, Celery, Celerybeat, Redis, PostgreSQL and Websocket).

PREVIEW

Running CryptBEE with Docker Compose

Follow these steps to set up and run CryptBEE using Docker Compose:

Prerequisites:

  • Make sure you have Docker and Docker Compose installed on your machine. If not, you can install them here.

1. Clone the Repository:

Clone the CryptBEE repository to your local machine using the following command:

git clone https://github.com/anshumannandan/cryptBEE

2. Navigate to the project directory:

cd cryptBEE

3. Configure the Environment Variables:

Edit the docker.env file located in the project's root directory to customize the environment variables to your specific requirements.

4. Start the Containers:

Build and start the Docker containers using the following command:

docker-compose up --build

This command will pull necessary images, build all the services, and start the containers.

5. Access the CryptBEE Web:

Once the containers are up and running, you can access the CryptBEE application in your web browser using the following URLs:

Default Admin Credentials:

Use the following credentials to access the admin panel:

Troubleshooting:

./entrypoint.sh not found

  • Open the entrypoint.sh file in a text editor.
  • Change the line ending sequence to LF (Line Feed). You can usually do this by configuring your text editor to save the file with LF line endings.
  • Save the changes to the entrypoint.sh file.
  • Rebuild the containers using the docker-compose up --build command.

./entrypoint.sh: permission denied

  • Grant execute permissions to the entrypoint.sh file using the following command:
sudo chmod +x entrypoint.sh

Setting Up CryptBEE on a Local Server

Follow these steps to set up CryptBEE on your local server:

Prerequisites:

  1. Python: Make sure you have Python installed on your machine. If not, you can install it here.

  2. PostgreSQL: Make sure you have PostgreSQL installed on your machine. If not, you can install it here.

  3. Redis: Make sure you have Redis installed on your machine. If not, you can install it here.

Getting Started:

1. Clone the Repository:

Clone the CryptBEE repository to your local machine using the following command:

git clone https://github.com/anshumannandan/cryptBEE

2. Navigate to the project directory:

cd cryptBEE

3. Create and Activate a Virtual Environment:

pip install virtualenv
virtualenv venv
venv/scripts/activate  # On Windows
source venv/bin/activate  # On Linux and macOS

4. Install the Dependencies:

pip install -r requirements.txt

5. Configure the Environment Variables:

Create a .env file in the cryptBEE/cryptBEE directory and add the following environment variables to it:

SECRET_KEY=
DEBUG=

DATABASE_NAME=
DATABASE_USER=
DATABASE_PASSWORD=
DATABASE_HOST=

TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_DEFAULT_CALLERID=

EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=

CRYPTOCOMPARE_API_KEY=

6. Create the Database:

Create a PostgreSQL database and connect to it by entering credentials in .env file, once connected run the migrate command:

python manage.py migrate

7. Create a Superuser:

You can create a superuser account executing the following commands:

python manage.py createsuperuer

A prompt will appear asking for email followed by password.

Alternatively, you can create a superuser by using the following custom command:

python manage.py add_superuser --email <email> --password <password>

8. Run the Backend Server:

python manage.py runserver

Access the endpoints in your web browaer: http://localhost:8000

Access the Django Admin Panel, go to: http://localhost:8000/admin

Use the superuser credentials to login.

9. Run the Websocket Server:

In a separate terminal with the virtual environment activated:

python websocket.py

You can connect to the websocket from your shell using this command:

python -m websockets ws://localhost:8001/

10. Run Celery Worker:

In a separate terminal with the virtual environment activated:

celery -A cryptBEE worker --pool=solo -l info

11. Run Celery Beat:

In a separate terminal with the virtual environment activated:

celery -A cryptBEE beat -l info

These steps will get you up and running with the CryptBEE backend on your local machine.

Frontend Contributor

cryptbee's People

Contributors

anshumannandan avatar deepsource-io[bot] avatar

Stargazers

Amirhossein Mohammadi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.