Giter Site home page Giter Site logo

fastboiler's Introduction

Fastboiler

A FastAPI + Celery + Redis skeleton/example project

Service Port
Frontend 8000
Dashboard 5555
Backend/Redis 6379

Project structure

project 
│   docker-compose.yml [Docker Compose build/deployment]
│
└───ansible [Playbooks and roles for automated deployment]
│
└───src [Application source code root]
    │   Dockerfile [Docker image build instructions]
    │   main.py [Application entrypoint]
    │   requirements.txt [Python dependencies]
    │
    └───api [REST API source code root]
        │   
        └───core [General/Core application code]
        │   │   config.py [Application configuration definitions]
        │   │
        │   └───logic [General/Background tasks/logic]
        │   │   
        │   │
        │   └───models [Core data objects definitions]
        │   
        └───api_vX
        │   │   api.py [APIRouter definition and endpoint routing]
        │   │
        │   └───endpoints [API endpoint definitions]
        ...

Setup and running locally

Install dependencies

# Python
sudo apt install python3 python3-dev python3-venv -y
curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3
# Redis
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt update
sudo apt install redis -y
sudo systemctl enable redis
sudo systemctl start redis

Setup virtualenv

python3 -m venv venv
. ./venv/bin/activate
pip install -r ./src/requirements.txt
deactivate

Running

Open two (three if you want to run the monitoring dashboard) terminal windows

Frontend

Start the frontend in one of the terminals by running the following

. ./venv/bin/activate
cd src
uvicorn main:app --host 0.0.0.0 --reload

Backend

Start the backend in one of the terminals by running the following

. ./venv/bin/activate
cd src
celery -A worker.celery worker --loglevel=info --logfile=logs/celery.log

Monitoring Dashboard (optional)

Start the backend monitoring dashboard by running the following

. ./venv/bin/activate
cd src
celery -A worker.celery flower --port=5555 --broker=redis://localhost:6379/0

fastboiler's People

Contributors

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