Coder Social home page Coder Social logo

todolist's Introduction

TodoList

Test task for RubyGarage

Project use on client: HTML, CSS, JavaScript. On backend: Python (Flask Framework). Database - SQLite.

Install and run project

    git clone https://github.com/zelenyid/TodoList.git
    cd TodoList
    pipenv install
    python3 run.py

For running you need to ser environment variables: SECRET_KEY and SQLALCHEMY_DATABASE_URI

SECRET_KEY you can give next steps in python interpreter:
    import secrets

    sectets.token_hex(16)

SQLALCHEMY_DATABASE_URI it's uri to your database

Functional requirements

  • I want to be able to create/update/delete projects (done)
  • I want to be able to add tasks to my project (done)
  • I want to be able to update/delete tasks (done)
  • I want to be able to prioritize tasks into a project (done)
  • I want to be able to choose deadline for my task (done)
  • I want to be able to mark a task as 'done' (done)

Additional functionality

  • It should work like one page WEB application and should use AJAX technology, load and submit data without reloading a page. (not done)
  • It should have user authentication solution and a user should only have access to their own projects and tasks. (done)
  • It should have automated tests for the all functionality (not done)

SQL

Given tables:

  • tasks (id, name, status, project_id)
  • projects (id, name)
  1. Get all statuses, not repeating, alphabetically ordered
    SELECT DISTINCT status FROM tasks ORDER BY status ASC;
  1. Get the count of all tasks in each project, order by tasks count descending
    SELECT project_id, COUNT(id) count_of_tasks FROM tasks 
    GROUP BY project_id 
    ORDER BY count_of_tasks DESC;
  1. Get the count of all tasks in each project, order by projects names
    SELECT projects.name, COUNT(tasks.id)
    FROM projects JOIN tasks ON projects.id = tasks.project_id
    GROUP BY tasks.project_id
    ORDER BY projects.name ASC;
  1. Get the tasks for all projects having the name beginning with "N" letter
    SELECT * FROM tasks WHERE name LIKE 'N%';
  1. Get the list of all projects containing the 'a' letter in the middle of the name, and show the tasks count near each project. Mention that there can exist projects without tasks and tasks with project_id = NULL
    SELECT p.name, COUNT(t.id) 
    FROM projects p JOIN tasks t ON p.id = t.project_id
    WHERE t.name LIKE '%a%'
    GROUP BY t.project_id;
  1. Get the list of tasks with duplicate names. Order alphabetically
    SELECT name, COUNT(*) count FROM tasks
    GROUP BY name
    HAVING count > 1
    ORDER BY name;
  1. Get list of tasks having several exact matches of both name and status, from the project 'Garage'. Order by matches count
    SELECT t.name, t.status, COUNT(*) count
    FROM tasks t JOIN projects p ON t.project_id = p.id
    WHERE p.name = 'Garage' GROUP BY t.name, t.status
    HAVING count > 1 ORDER BY count ASC;
  1. Get the list of project names having more than 10 tasks in status 'completed'. Order by project_id
    SELECT p.name, COUNT(t.project_id) as count
    FROM task t JOIN project p ON t.project_id = p.id
    WHERE t.status = 'completed' GROUP BY t.project_id
    HAVING count > 10 ORDER BY p.id; 

todolist's People

Contributors

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