|
| 1 | +--- |
| 2 | +categories: |
| 3 | + - GSoC |
| 4 | + - 2021 |
| 5 | + - Work Report |
| 6 | +date: 2021-08-22 |
| 7 | +student: Prashant Dodiya |
| 8 | +organisation: coala |
| 9 | +organisation_link: https://coala.io |
| 10 | +project: Microfarm For Everybody |
| 11 | +project_link: https://summerofcode.withgoogle.com/projects/#6093515215339520 |
| 12 | +mentors: > |
| 13 | + [Finn Peters](https://github.com/finn-1), |
| 14 | + [KV Garg](https://github.com/kvgarg) & |
| 15 | + [Abhinav Kaushlya](https://github.com/abhishalya) |
| 16 | +phase: |
| 17 | + - Bonding: https://gitlab.com/coala/GSoC/gsoc-2021/-/milestones/11 |
| 18 | + - Phase 1: https://gitlab.com/coala/GSoC/gsoc-2021/-/milestones/6 |
| 19 | + - Phase 2: https://gitlab.com/coala/GSoC/gsoc-2021/-/milestones/10 |
| 20 | +bio: > |
| 21 | + I am a pre-final year student (expected graduation month - May 2023) |
| 22 | + studying Electronics and Communication Engineering at [Sardar Vallabhbhai |
| 23 | + National Institute of Technology](https://www.svnit.ac.in), Surat, India. I |
| 24 | + have participated in GSoC'21 with [WeField e.V.](https://www.wefield.org) |
| 25 | + under the umbrealla of [coala Association e.V.](https://coala.io) open-source |
| 26 | + organization. |
| 27 | +
|
| 28 | + My project, Microfarm For Everybody (Django-Microfarm), aims to create a |
| 29 | + tool that allows anyone to become a market gardener, given some space. As a |
| 30 | + first step, a user will merely sign up and enter the amount of space that |
| 31 | + they wants to use. The system will then trigger tasks the user has to do to |
| 32 | + farm on his space efficiently. Those tasks are triggered by simple rules and |
| 33 | + may depend on weather events, date, and later also other triggers. Thus, |
| 34 | + anyone can be a market gardener, and this tool will be beneficial and easy |
| 35 | + to use. |
| 36 | +
|
| 37 | +social: |
| 38 | + - GitHub: |
| 39 | + - username: pra17dod |
| 40 | + - link: https://github.com/pra17dod |
| 41 | + - GitLab: |
| 42 | + - username: pra17dod |
| 43 | + - link: https://gitlab.com/pra17dod |
| 44 | + - Gitter: |
| 45 | + - username: pra17dod |
| 46 | + - link: https://gitter.im/pra17dod |
| 47 | + - Linkedin: |
| 48 | + - username: Prashant Dodiya |
| 49 | + - link: https://www.linkedin.com/in/pra17dod/ |
| 50 | + |
| 51 | +blog: https://pra17dod.medium.com/ |
| 52 | + |
| 53 | +activity: |
| 54 | + - 1: |
| 55 | + - repo: GSoC/GSoC-2021 |
| 56 | + - link: https://gitlab.com/coala/GSoC/gsoc-2021/-/issues/2 |
| 57 | + - details: > |
| 58 | + Business Model Canvas of Django Micorfarm |
| 59 | +
|
| 60 | + - 2: |
| 61 | + - repo: GSoC/GSoC-2021 |
| 62 | + - link: https://gitlab.com/coala/GSoC/gsoc-2021/-/issues/1 |
| 63 | + - details: > |
| 64 | + Deciding project requirements and database handling |
| 65 | +
|
| 66 | + - 3: |
| 67 | + - repo: GSoC/GSoC-2021 |
| 68 | + - link: https://gitlab.com/coala/GSoC/gsoc-2021/-/issues/44 |
| 69 | + - details: > |
| 70 | + Create Wireframe of the application |
| 71 | +
|
| 72 | + - 4: |
| 73 | + - repo: django-microfarm |
| 74 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/7bb8deed141787a7a5b4c0e1f21bd44ea83955d0 |
| 75 | + - details: > |
| 76 | + proposal.md: Add Django Microfarm Proposal |
| 77 | +
|
| 78 | + - 5: |
| 79 | + - repo: django-microfarm |
| 80 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/01238b59ec3ef4b3deaaf40b6fae09d0acde6f99 |
| 81 | + - details: > |
| 82 | + Add django-microfarm setup |
| 83 | +
|
| 84 | + - 6: |
| 85 | + - repo: django-microfarm |
| 86 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/aaebe721cbbd372c43fe99003847990976ca5982 |
| 87 | + - details: > |
| 88 | + settings.py: Setup environment variables and test-requirements |
| 89 | +
|
| 90 | + - 7: |
| 91 | + - repo: django-microfarm |
| 92 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/60263178b166f715a10ccd420933b3db9852e035 |
| 93 | + - details: > |
| 94 | + gitlab-ci.yml: Add CI for `black` linter |
| 95 | +
|
| 96 | + - 8: |
| 97 | + - repo: django-microfarm |
| 98 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/dc55abe5a0c551afad3b7a052ab024f9ca638ef3 |
| 99 | + - details: > |
| 100 | + Add User Authentication System |
| 101 | +
|
| 102 | + - 9: |
| 103 | + - repo: django-microfarm |
| 104 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/d7996efdcc1290fec8aa8fc764a2c18dab729eb0 |
| 105 | + - details: > |
| 106 | + Add market-garden schemas |
| 107 | + - 10: |
| 108 | + - repo: django-microfarm |
| 109 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/7531640968c065e632e46f7f379919c302e5945b |
| 110 | + - details: > |
| 111 | + Add market-garden cropmap script |
| 112 | + - 11: |
| 113 | + - repo: django-microfarm |
| 114 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/901a03d0a757cc0304b387b44873c599c89d7b25 |
| 115 | + - details: > |
| 116 | + Add watering script using Weather and Forecast API |
| 117 | + - 12: |
| 118 | + - repo: django-microfarm |
| 119 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/ffaa59e6cd82166bdb52b62ec3ba70eeff70e5c4 |
| 120 | + - details: > |
| 121 | + Implement watering tasks |
| 122 | +
|
| 123 | + - 13: |
| 124 | + - repo: django-microfarm |
| 125 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/fc927e02c443ee733a7ebe9ac432e18d6a3e3bd7 |
| 126 | + - details: > |
| 127 | + Create Section and Bed objects |
| 128 | +
|
| 129 | + - 14: |
| 130 | + - repo: django-microfarm |
| 131 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/ee392894b6b3309e8251d7944550be0074eca11c |
| 132 | + - details: > |
| 133 | + Create todo tasks objects |
| 134 | +
|
| 135 | + - 15: |
| 136 | + - repo: django-microfarm |
| 137 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/b8c3051e34d5f614b161a5ec6319a82903c063e3 |
| 138 | + - details: > |
| 139 | + Create all the endpoints for the Application |
| 140 | + - 16: |
| 141 | + - repo: django-microfarm |
| 142 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/d805b64bf7f7210308b0451977e5da5175fbf5c1 |
| 143 | + - details: > |
| 144 | + Implement APIs Documentation |
| 145 | +
|
| 146 | + - 17: |
| 147 | + - repo: django-microfarm |
| 148 | + - link: https://gitlab.com/coala/django-microfarm/-/commit/461a1111f36720cef10efefd67bc4bfe7046cb87 |
| 149 | + - details: > |
| 150 | + Creating single migration file for each model |
| 151 | +--- |
| 152 | + |
| 153 | +### Microfarm For Everybody |
| 154 | + |
| 155 | +#### Work Done |
| 156 | + |
| 157 | +1. Designed Business Model Canvas |
| 158 | +2. Created Wireframe for the application |
| 159 | +3. Project setup and CI for `black` linter |
| 160 | +4. Setted up a User Authentication System |
| 161 | +5. Implemented database and schemas |
| 162 | +6. Implemented script to calculate the crop map and compost required |
| 163 | +7. Implemented weather and forecast API and script to check if watering is required or not? |
| 164 | +8. Implemented watering tasks |
| 165 | +9. Implemented daily tasks |
| 166 | +10. Setted up `django-signals` and `celery` to automatically create objects such |
| 167 | + Section and Bed objects, periodic tasks and todo objects. |
| 168 | +11. Implemented Todo task objects. |
| 169 | +12. Implemented APIs fetching the details, rules and tasks of the currently |
| 170 | + logged in user. |
| 171 | +13. Added APIs documentation using drf-yasg |
| 172 | + |
| 173 | +#### Challenges |
| 174 | + |
| 175 | +The biggest challenge was writing the codebase from scratch such that it can |
| 176 | +become the strong foundation of the application in the future. It took time to |
| 177 | +design the project structure and deciding on the schemas of database. I learnt a |
| 178 | +lot during the journey, so learning new things also consumed time. The hurdles |
| 179 | +were: |
| 180 | + |
| 181 | +1. Designing the database and setting up `JWT(Json Web Token)` Authentication and Social |
| 182 | + Authentication. |
| 183 | +2. Writing the script calculating all the Cropmap parameters which should work |
| 184 | + in all the cases. |
| 185 | +3. Deciding on Watering Rules and writing the script that will check if we need |
| 186 | + to water our garden or not, on the basis of the rules. |
| 187 | +4. Setting up periodic tasks to check hourly weather to update the time when the |
| 188 | + garden was watered by the rain. |
| 189 | +5. Using `django-signals`, to automatically create objects and run scripts. For |
| 190 | + e.g., on saving a Market-Garden, a function to calculate cropmap and to |
| 191 | + create sections and beds objects should be executed. |
| 192 | +6. Implementing `celery`, to queue up these tasks and also to implement periodic |
| 193 | + tasks. |
| 194 | +7. Creating a task objects, such that it holds the status of the task to be |
| 195 | + done and its details. |
| 196 | +8. Automatic creation of all the tasks related to the Market-Garden and get the |
| 197 | + list of ToDo for the day. |
| 198 | +9. Creating APIs of the application and setting the permission such that every |
| 199 | + API return the objects that are owned by the user and if objects are public |
| 200 | + then they can only view the object. |
| 201 | +10. Fetching user details from the `JWT` Access token by decoding it. |
| 202 | + |
| 203 | +#### Work left to be done |
| 204 | + |
| 205 | +Unit tests for the models and functions, deployment of the application |
| 206 | +and some improvised documentation are required to be done. |
0 commit comments