Coder Social home page Coder Social logo

syncflow's Introduction

๐Ÿš€ SyncFlow

SyncFlow Diagram

Welcome to SyncFlow, a powerful tool for synchronizing data with external services effortlessly!

Tech Stack Used ๐Ÿง‘โ€๐Ÿ’ป

  • Python ๐Ÿ
  • Django (Django ORM for communicating with the DB, web framework for accepting webhook data) ๐Ÿฆ„
  • RabbitMQ (as a message queue between Celery (consumer) and Django (producer)) ๐Ÿ‡
  • Redis (as a backend result storage)
  • Celery (to spawn workers and as a consumer for RabbitMQ) ๐Ÿฅฌ
  • Celery Beat (for API polling and periodic task scheduling, not required if no periodic task scheduling exists)
  • [Optional] Flower (web interface) to monitor Celery tasks ๐ŸŒป

Features ๐Ÿ‘€

  • Integrate with one connect with all
  • Easy Framework for Data Synchronization with External Services
  • Removes repetitive tasks, so you can focus on integration only.
  • High Fault Tolerance using RabbitMQ and Redis
  • Fast Performance using Celery

Content ๐Ÿ—’๏ธ

Setup

Prerequisites of Setup

Step 1: Clone the repository.

Step 2: Create a virtual environment (recommended):

python3 -m venv venv
source venv/bin/activate

Step 3: Enter the SyncFlow directory, our whole application lies there.

Step 4: Install dependencies:

pip install -r requirements.txt

Step 5: Apply migrations:

python manage.py migrate

Step 6: Create a .env file and place it in the same directory as the README. Your .env should look like:

SECRET_KEY =
STRIPE_API_KEY =
STRIPE_ENDPOINT_SECRET =
CELERY_BROKER_URL =   # RabbitMQ URL in our case but can be other message queues as well
CELERY_RESULT_BACKEND = # Redis in our case but can be something else
FLOWER_BROKER = # RabbitMQ in our case
FLOWER_PORT =

Step 7: Make sure RabbitMQ and Redis are running.

Step 8: Start the development server:

python manage.py runserver

Step 9: Start Celery Worker

In a new terminal window, navigate to your project directory and start the Celery worker:

celery -A syncflow worker --loglevel=info

Step 10: Start Celery Beat

If you have periodic tasks that need to be scheduled, you can start Celery Beat:

celery -A syncflow beat --loglevel=info

Step 11: Monitor Celery Tasks (Optional)

To monitor your Celery tasks, you can use tools like Flower. Populate your .env with Flower configurations.

celery flower -A syncflow --port=5555

You can access the Flower dashboard at http://localhost:5555.

That's it! Your Django app with Celery, RabbitMQ, and Redis is up and running. You can now use Celery to perform background tasks and monitor their progress if needed.

syncflow's People

Contributors

melencholicmice avatar

Watchers

 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.