Open city profile is used to store common information (name, contact information, areas of interests, ...) about the citizens of the city of Helsinki.
When a citizen is using a service which is connected to the profile, the service can query for the citizen's information from the profile so that the citizen doesn't have to enter all of their data every time it is needed. The services may also provide a better user experience using the profile's data, for example by returning more relevant search results based on the citizen's interests.
The same data may also be queried by the employees of the city of Helsinki while performing their daily duties, for example using the administrative functions of Venepaikka service.
Open city profile is implemented using Django and it provides a GraphQL API.
-
Create
.env
environment file -
Set the
DEBUG
environment variable to1
-
Run
docker-compose up
-
Run migrations if needed:
docker exec profile-backend python manage.py migrate
-
Create superuser if needed:
docker exec -it profile-backend python manage.py createsuperuser
-
Import relevant Helsinki regions if needed:
docker exec profile-backend python manage.py geo_import finland --municipalities
docker exec profile-backend python manage.py geo_import helsinki --divisions
docker exec profile-backend python manage.py mark_divisions_of_interest
-
Run the server:
docker exec -it profile-backend python manage.py runserver 0:8000
- Run
pip install pip-tools
- Run
pip-compile requirements.in
- Run
pip-compile requirements-dev.in
- Run
pip-compile --upgrade requirements.in
- Run
pip-compile --upgrade requirements-dev.in
- Run
pip-sync requirements.txt requirements-dev.in
To setup a database compatible with default database settings:
Create user and database
sudo -u postgres createuser -P -R -S open_city_profile # use password `open_city_profile`
sudo -u postgres createdb -O open_city_profile open_city_profile
Allow user to create test database
sudo -u postgres psql -c "ALTER USER open_city_profile CREATEDB;"
In order to have the relevant Helsinki regions run the following commands:
python manage.py geo_import finland --municipalities
python manage.py geo_import helsinki --divisions
python manage.py mark_divisions_of_interest
- Set the
DEBUG
environment variable to1
. - Run
python manage.py migrate
- Run
python manage.py runserver 0:8000
- Set the
DEBUG
environment variable to1
. - Run
pytest
.
Currently no automated builds.
Test environment: https://profile-api.test.hel.ninja/profile-test/graphql/
Make your changes and create a pull request. If your PR isn't getting approved, contact kuva-open-city-profile-developers@googlegroups.com.