Giter Site home page Giter Site logo

sparky-backend-public's Introduction

Sparky

Your plans are our duty!

Sparky is a planning application that automatically schedules daily activities for users. It allows users to select from pre-defined activities or create custom ones. They can also configure the randomization frequency, set the time that usually fits for the activity, specify the duration, and effort it takes. Users can track their progress within the app and make adjustments to their routine instantly. Furthermore, the app analyzes personal user activity to facilitate their day organization. It is planned to integrate with various notification systems, such as Google Calendar.

The mission of this app is to automate people's activities and organization routines as much as possible to ease their daily lives.

This repository contains the Back-end application

Built with Cookiecutter Django Black code style

Project structure overview

.
└── sparky/
    ├── authorization/
    │   ├── services/ [Logic for OAuth flow management]
    │   └── views.py [Views for Google OAuth flow]
    ├── activities/
    │   ├── api/
    │   │   └── v1/ [URLs, views, and serializer to modify activities]
    │   ├── models/ [Model classes related to the activities and their management]
    │   ├── selectors/ [DB queries related to the activities]
    │   └── services/ [Activities lifecycle management]
    │       └── tests/ [Test cases for the services]
    ├── core/ [Project-scoped entities, general utility logic]
    ├── integrations/
    │   ├── adapters/ [Contains adapters implementing single interface interaction with third-party integrations (e.g. Google Calendar)]
    │   ├── models/ [Models encapsulating external integration entities]
    │   └── services/ [Logic layer between models and adapters]
    │       └── tests/ [Test cases for the services]
    ├── users/ [User management logic]
    └── utils/ [Contribution project-scoped utilities]

Adopted styleguide reference: https://github.com/HackSoftware/Django-Styleguide

Settings

Moved to settings.

Pre-requisites

In order to have application up and running, first you need to create local envfile in .envs/.local/. The simplest way to accomplish that is to copy .envs/.test/* envfiles to .envs/.local/.

Basic Commands

The project uses Docker Compose configuration in order to ease environment deployment everywhere.

Setting up local project

Build the images from the Docker Compose file:

$ docker compose -f local.yml build --no-cache

Start containers from the built images:

$ docker compose -f local.yml up -d

Now, you should have all the project services up and running.

Executing commands

All the project-related command are needed to be executed out of Docker container. To do that you need run it along with the following prefix:

$ docker compose -f local.yml run --rm django <command_to_execute>

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

  • To create a superuser account, use this command:

    $ docker compose run --rm django python manage.py createsuperuser
    

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type checks

Running type checks with mypy:

$ docker compose -f local.yml run --rm django mypy sparky

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ docker compose -f local.yml run --rm django coverage run -m pytest
$ docker compose -f local.yml run --rm django coverage html
$ docker compose -f local.yml run --rm django open htmlcov/index.html

Running tests with pytest

$ docker compose -f local.yml run --rm django pytest

API Schema

Celery

This app comes with Celery.

There are three services integrating Celery:

  • celeryworker
  • celerybeat
  • flower

Flower lets observe task execution and its performance. By default, it should be accessible under: http://127.0.0.1:5555

Docker

See detailed cookiecutter-django Docker documentation.

sparky-backend-public's People

Contributors

b4lex avatar dependabot[bot] avatar lensnel 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.