Skip to content

natuspati/to-do

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn Contributors Forks Stargazers Issues MIT License


Logo

To Do

A simple backend for a todo app.

Table of Contents
  1. About the Game
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Contact
  7. Acknowledgments

About the Project

To Do is a basic app for tracking tasks.

  • Tasks have name, description and status.
  • Status can be pending, completed or cancelled.
  • CRUD operations use asynchronous client for MongoDB
  • Unit tests cover valid and invalid inputs.

(back to top)

Built With

Back-end is built with FastAPI using Test Driven Development.

  • Pytest is chosen for its mature resources and extensive ecosystem of plugins.
  • MongoDB is database.
  • Motor is asynchronous driver with Pymongo as Object Document Mapper.
  • Dependencies are used to isolate logic from routes.

FastAPI MongoDB Pytest

(back to top)

Getting Started

Pre-requisites

Use pipenv package for a deterministic build instead of pip and requirements.txt, which can be installed with

pip install pipenv

For MongoDB, either a free remote database can be set up using this link or a local instance can be run following these instructions.

Installation

  1. Clone the repo
    git clone https://github.com/natuspati/to-do.git
  2. Edit example.env with MongoDB URL from pre-requisites and create a copy .env
    cd to-do/backend
    cp example.env .env
  3. Install packages using pipenv
    pipenv install
    or from requirements.txt
       pip install -r requirements.txt
  4. Run uvicorn command
    uvicorn app.api.server:app --reload --host 127.0.0.1 --port 8000
  5. Visit http://127.0.0.1:8000/

(back to top)

Usage

Running tests

TDD principle dictates

Write test that fails and add just enough code to make the test pass.

The project uses this principle and extensibility of backend/tests/ shows that.

To run the tests, use the command:

pytest -v backend/tests 

Screenshots

Default Default Default Default

(back to top)

Roadmap

  • Configure asynchronous MongoDB driver that is able to connect/disconnect with the app events
  • Configure Pytest with asynchronous test client
  • Add Task CRUD endpoints
  • Isolate ODM operations to repositories
  • Add user authentication and resouce management
  • Create Behavior Driven Tests from client and cleaner points of view

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Nurlat Bekdullayev - @natuspati - [email protected]

Project Link: https://github.com/natuspati/to-do

(back to top)

Acknowledgments

Thanks to these resources that helped me to build the game.

(back to top)

About

To Do app using FastAPI and MongoDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages