gerilife / companionship Goto Github PK
View Code? Open in Web Editor NEWPromoting companionship and well-being for everyone.
License: European Union Public License 1.2
Promoting companionship and well-being for everyone.
License: European Union Public License 1.2
The app currently sets a default value for the "display name" field. Rather than use the default value, it would be better if users could set their given name when registering for the app.
Related to #36
We want to create a minimum-viable notification app that runs on mobile devices (Android and iOS). The application should, at a minimum, display a notification text to remind the user of the tasks for which they are responsible. The notification should be scheduled and delivered on a timely basis. Notifications should be created by the "backend" app and somehow scheduled on or delivered to the mobile app.
When adding an activity, the following error displays
Cannot resolve keyword 'companions' into field. Choices are: activities, companions_through, display_name, email, groups, id, is_staff, is_superuser, join_requests, last_login, logentry, password, user_permissions
We would like to send reminder notifications to caregivers so they remember the tasks they have agreed to take. These notifications can be:
Currently, if a user forgets their password they cannot request a password reset.
We are using "care organizers" and "care coordinators" interchangeably through the code and UI. Choose one form, "coordinator" or "organizer", and update the code so it is consistent throughout the app.
The default theme is quite bright on the eyes. It may be nice to provide an alternative dark theme.
We don't currently run any CI jobs to verify that commits pass tests, for example.
TODO:
format
pipeline to lint
(since it is only checking lint)autopep8
check from test
pipeline to lint
pytest
unit tests in test
pipeline (since they are the actual tests)Alternatively
format
to lint_and_test
with a useful alias like "Lint and test"autopep8
task to lint_and_test
python project/manage.py test
in format_and_test
as a job called test
test
flow, since it contains redundant stepsAt some point, we may look into more efficient use of these runners. For now, a single runner is fine, since they share dependencies.
By convention, Django defines accounts templates in a registration
directory. However, due seemingly to a bug, Django is not detecting templates in the registration
directory, even when following the documented naming conventions:
https://code.djangoproject.com/ticket/34003
At some point if possible, try to move the templates for the Django default Auth views to a registration
directory within project/accounts/templates
.editorconfig
file to the root directory of this project with the following contents# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
The Person Activity template currently renders several modal dialogues. This means that for each scheduled activity, there is a lot of repeated code. Rather, it would be better to instantiate the dialogue via JavaScript or somehow render a single instance of each relevant dialogue to which we can pass the necessary arguments.
Task
Currently, users have no way to indicate that an activity was completed, such as doing housework. The assumption is that all past activities were completed, but that may not be the case.
django-debug-toolbar
with the command poetry add django-debug-toolbar --group dev
Since we are developing this project in Finland, we can start with the Finnish locale.
Task
We are currently using CodeClimate for quality review in our pull requests. CodeClimate can monitor test coverage if we configure our project correctly.
Something similar to the following may be all that is needed to enable test reporting in our project.
coverage:
needs: [ test ]
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: '3.10'
- run: poetry install
- run: coverage run -m pytest
Consider adding Watchman and pywatchman
to this project as optional developer dependencies. Make sure to update the CONTRIBUTING guide as necessary.
The group organizer may need to edit companion settings, such as removing a temporary companion #28 or designating a companion as a care organizer.
Add a user profile feature to allow people to set/change their first name and password. Consider removing the last name field for privacy. Consider whether to add avatar support (possibly as a subsequent feature).
Currently, when a user registers, they must then log in.
While we are in an early stage of testing, we can make things as easy as possible for new users. Even as the project matures and we want to start validating emails, it may be nice for new users to automatically log in during an email validation grace period.
When a user registers, automatically log them in.
django-browser-reload
for this projectpoetry add mypy --group dev
poetry add --group dev django-stubs[compatible-mypy]
pyproject.toml
[tool.mypy]
plugins = ["mypy_django_plugin.main"]
[tool.django-stubs]
django_settings_module = "myproject.settings"
We want to support multiple languages. There are several steps we need to complete in order to enable project localization.
When a care coordinator accepts a caregiving membership application, the following error displays
'QuerySet' object has no attribute 'add'
Once we have refactored the project to have Person
and Companion
models #16, we can add companion invitations. For the MVP, we should keep the invitation system very simple. We don't want to introduce any dependencies such as a mail service.
Rather, allow care coordinators to copy an invitation link that they can email to other companions. When a person clicks the invitation link, they need to be signed in and then can click an "apply" or "join" button. The care coordinator must also verify the companionship applications, to reduce the likelihood of abuse.
project/core/management/commands/makemigrations.py
with the following contentfrom django.core.management.base import CommandError
from django.core.management.commands.makemigrations import (
Command as BaseCommand,
)
class Command(BaseCommand):
def handle(self, *app_labels, name, dry_run, merge, **options):
if name is None and not dry_run and not merge:
raise CommandError("-n/--name is required.")
super().handle(
*app_labels,
name=name,
dry_run=dry_run,
merge=merge,
**options,
)
Users may want to add a brief note to an activity, such as to provide a bit more information for participants. However, we should be careful about the amount ant type of information users are encouraged to store. Hence, the note
field should be limited to around 50 characters and should warn the user about privacy concerns.
note
field to the Activity
model (50 char max)factory_boy
to this project with poetry add factory_boy --group dev
Currently, there is no way for users to change their password.
Currently, when an unregistered user clicks an invitation link, they are prompted to register but are not redirected to apply for membership in the caring circle. Ideally, the application would automatically submit when a person registers or logs in with an invitation link. When a person is already logged in, the application would also be submitted.
TODO: consider whether the application should be auto-submitted or the user should click one more button to apply when viewing the application page.
Add the following to the caregivers app, potentially as separate issues:
Care coordinators may want to export data from their person-centric care groups. For the minimum-viable feature, we can allow a single care-group (Person
) data to be exported.
Person
Person
page creating an export in a common formatWe don't currently have error page templates. The default error pages are confusing and don't render in our site base template.
Task
Currently, anyone with the link to a person's page can view the person's details and add events.
Users may want to add the upcoming activities to their calendar. One common way to integrate event information into a calendar is the iCal format.
Circle
circle/{ circle_id }/calendar.ical
poetry add ipython --group dev
The Person
model currently contains an id
field which uses UUID
for unique values. The reason UUID was chosen was so sequential IDs could be avoided in URLs. However, the UUID URLs are quite lengthy.
There may be a way to use the default, sequential ID field for users while adding Base64 encoding for URL parameter. The key functionality is that the URL should not be easy to guess from any given URL.
References
In preparation for a tiered service offering, we will limit the maximum number of Caring Circles to 1 per user.
Some companionship relationships may be temporary. As such, the care coordinator may need to remove existing companions.
CompanionDeleteView
, based on the Django generic View class-based viewCompanionDeleteView
takes only a post
requestCompanionDeleteView
validates that user one of Person
's organizers
or throws NotAuthorized
errorCompanionDeleteView
post method will redirect to the PersonDetailView
for the relevant personThe following code snippets may be useful as examples related to this task.
Checking if request User
is one of Person
's organizers
https://github.com/GeriLife/companionship-care/blob/d7cdcdc1a37e5bd08f9c7b6a26a8116b9571ce5e/project/people/templates/people/person_detail.html#L104
Preventing a user from removing themself by checking equality (in our case, it should be !=
)
https://github.com/GeriLife/companionship-care/blob/d7cdcdc1a37e5bd08f9c7b6a26a8116b9571ce5e/project/people/templates/people/person_activity.html#L70
Linking to a specific view, using the view name
and optional arguments
https://github.com/GeriLife/companionship-care/blob/d7cdcdc1a37e5bd08f9c7b6a26a8116b9571ce5e/project/people/templates/people/person_detail.html#L130-L132
Ensuring only a Person
's organizer can perform database operations related to that person
https://github.com/GeriLife/companionship-care/blob/d7cdcdc1a37e5bd08f9c7b6a26a8116b9571ce5e/project/people/views.py#L130-L137
Redirect to Person
's detail view after removing the companion:
https://github.com/GeriLife/companionship-care/blob/d7cdcdc1a37e5bd08f9c7b6a26a8116b9571ce5e/project/people/views.py#L154
People who log in and register may see a primarily empty front page. It would be more convenient if they were redirected to one of the following.
After some more consideration, I think a solution would look like:
There is currently only one view in the Activities app that uses permissions to verify user access. Add related permissions to the remaining views, using the UserPassesTestMixin
as seen in the 'ActivitySetDoneView`.
UserPassesTestMixin
Our data model currently defines a Group
model, which represents a care group for a particular person. Rather than the Group
model being the primary entity, it would align more with our conceptual model and vision to have a Person
model be the central entity.
Group
model with a Person
modelMember
model with a Companion
modelPerson
modelpoetry add rich --group dev
LOGGING = {...}
configuration in the project settings"formatters": {
"rich": {"datefmt": "[%X]"},
},
"console": {
"class": "rich.logging.RichHandler",
"filters": ["require_debug_true"],
"formatter": "rich",
"level": "DEBUG",
"rich_tracebacks": True,
"tracebacks_show_locals": True,
},
The pre-commit
script can help enforce good code practices. Similarly, Pre-Commit CI can auto-check pre-commit rules on pull requests.
pre-commit
for this projectThe upcoming events list may grow to many items. A common pattern for long lists is to add pagination, allowing the user to view only a few items at a time.
It would be useful for people to add comments to an activity.
Sometimes activities get cancelled for various reasons. Allow care coordinators to delete scheduled activities.
When logging in, users are currently redirected to the "home" page. Instead, we can redirect them to the "people" page to save a click.
Task
The "caregivers" app is currently a work-in-progress. It should be hidden from normal users until it is ready for use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.