├── setup_intructions.md ├── assignment-scorecard.md ├── README.md └── .gitignore /setup_intructions.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assignment-scorecard.md: -------------------------------------------------------------------------------- 1 | # Assignment Scorecard 2 | 3 | ## Technical Assignment 4 | 5 | | Did the candidate: | Yes | No | 6 | | :------------------------------------------------------------------------------------------------------------------- | :-- | :-- | 7 | | Complete all the tasks in assignment? | | | 8 | | Follow steps and instructions provided carefully? | | | 9 | | Write code that follows best-practices? | | | 10 | | Demonstrate understanding of the code they wrote? | | | 11 | | Account for different use cases (e.g: case-insensivity in search, trying to update/delete nonexisting resource etc.) | | | 12 | | Follow proper git process and guidelines? | | | 13 | | Complete the assignment in an efficient manner? | | | 14 | | Go beyond what was asked of them? | | | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Django Interview Assignment 2 | A django rest framework based web api's application that will be used by our candidates to implement interview assignment. 3 | 4 | ## Dependencies 5 | This project relies mainly on Django. Mainly: 6 | - Python 3.8+ 7 | - Django 3+ or 4+ 8 | - Django Rest Framework 9 | 10 | ## Requirements: 11 | - Candidates expected to implement required features for a library management system based on provided scenario 12 | - Candidates have to implement web REST api's for each required action related to scenario 13 | - Proper [JWT][1] based authentication should be implemented in each protected web api endpoint 14 | - Ensure an user can only perform actions using apis which are allowed to the role assigned to that user 15 | 16 | 17 | ### Scenario 18 | The are two roles in the system; `LIBRARIAN` and `MEMBER` 19 | 20 | ### As a User 21 | - I can signup either as `LIBRARIAN` and `MEMBER` using username and password 22 | - I can login using username/password and get JWT access token 23 | 24 | #### As a Librarian 25 | - I can add, update, and remove Books from the system 26 | - I can add, update, view, and remove Member from the system 27 | 28 | #### As a Member 29 | - I can view, borrow, and return available Books 30 | - Once a book is borrowed, its status will change to `BORROWED` 31 | - Once a book is returned, its status will change to `AVAILABLE` 32 | - I can delete my own account 33 | 34 | ## Nice to Have: 35 | It will be an advantage for candidates to demonstrate the following: 36 | - Proper usage of Http Methods and REST practices 37 | - Understanding of [SOLID Principle][2] 38 | - Understanding of Design patterns 39 | - Understanding of TDD and BDD 40 | - Each implementation should be equipped with unit tests 41 | - Integration tests are require to demonstrate API usages 42 | 43 | ## **Instructions** 44 | - [ ] Follow these steps for submission: 45 | 1. Fork the repository in your github account 46 | 1. Create issues and work on them in their respective branches 47 | 1. Complete the tasks while following all instructions 48 | 1. Create MRs and merge into main branch 49 | 1. When done, Test if all task requirements are met and instructions followed 50 | 1. Push code to github 51 | 1. Deploy/Host your solution 52 | 1. Reply to the same email with the URLs for **repo**, **hosted API** and **hosted documentation** 53 | - [ ] `setup_instructions.md` should have all the details and instructions like how to setup and run the project 54 | - [ ] Repo should not contain irrelevant folders/files like cache files, build/dist directories etc. 55 | - [ ] Create API documentation using Swagger or similar framework 56 | - For any queries please email us at [hiring@truevalueaccess.com](mailto:hiring@truevalueaccess.com) 57 | 58 | [1]: https://jwt.io/introduction 59 | [2]: https://en.wikipedia.org/wiki/SOLID -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | # PyCharm 156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 158 | # and can be added to the global gitignore or merged into this file. For a more nuclear 159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 | #.idea/ --------------------------------------------------------------------------------