Git Product home page Git Product logo

tasks's Introduction

How to run

Setup the development environment

Clone from repository

> mkdir projects
> cd projects
> git clone https://github.com/vatsaaa/tasks.git

Setup virtual environment

macOS/Linux

> cd tasks
> python3 -m venv .venv

Windows

> cd tasks
> python -m venv .venv

Get the code working

Activate the virtual environment and Install requirements

> ./.venv/bin/activate
> pip3 install -r requirements.txt

Run the app

> python3 app.py

Run celery

> pip3 install eventlet

celery -A taskqueue.tasks.celery_app worker --loglevel=DEBUG --pool=eventlet --purge

Test Successful running API

How to contribute to the project

Code

Add more functionality

Add definition to config/swagger.yml file

paths:
  /ping:
    get:
      summary: Health check url
      operationId: controllers.controllers.ping
      parameters:
        - in: query
          name: suffix
          required: false
          schema:
            type: string
          description: suffix is appended to response from the service 
      tags:
      - Health Check
      responses:
        200:
          description: ping( ) services responds to user's ping with pong and the time at which the srvice was invoked. e.g. 

Add corresponding code to controllers/controllers.py

def ping(suffix=None):
    resp_str = "User ping, tasks pong / " + dt.now().strftime("%Y-%m-%d, %H:%M:%S")
    resp = resp_str if suffix is None else resp_str + " / " + suffix
    return resp

Run and test from Swagger-UI

> python3 app.py
INFO:waitress:Serving on http://127.0.0.1:5454

Open the browser to visit page http://127.0.0.1:5454/api/v1/ui to launch the swagger ui and to test the service just added

Alternatively, one could use the cUrl utility as well:

curl -X 'GET' \
  'http://127.0.0.1:5454/api/v1/ping?suffix=suffix01' \
  -H 'accept: */*'

Code reviews and walkthroughs

Testing

Unit testing

Need to add unit testing for each module which should run nightly - for every branch Successful tests is the first criteria for accepting a merge request

Automated testing

Need to create automated functional tests which should run nightly - for every branch Successful tets is the first criteria for accepting a merge request

Documentation

Improve README.md

Improve wiki

Contribute to discussions

How to use redis-cli correctlyc

https://lightrun.com/dev-tools/using-the-redis-command-line/

https://redis.io/topics/data-types-intro

tasks's People

Contributors

vatsaaa avatar

Watchers

 avatar

tasks's Issues

Project needs Logging to be plugged

print( ) statements are used for debugging and indicating failures at various stages.

This needs to be replaced with proper logging library, also the right rolling mechanism for log-files needs to be implemented.

Write a DB abstraction layer

Class Database:
    def __init__(self, init_type):
        if init_type = ENUM(1):
            db_type = redis
        elif init_type = ENUM(2):
            db_type = kafka
        ::::
        ::::
       else:
           db_type = local_files
  

    def create(self):
        if db_type = redis:
            redis.insert()
        elif db_type = kafka:
            kafka.insert()
        :::::::
        :::::::
        else:
            local_files.insert()

    def read():
        ....

    def update():
        ....

    def delete():
        ....

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.