Skip to content

Commit 1363b53

Browse files
committed
Refactor readme to act as a landing page
1 parent d602d6c commit 1363b53

File tree

1 file changed

+42
-25
lines changed

1 file changed

+42
-25
lines changed

readme.md

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,68 @@
1+
# Welcome to Mesimä
2+
3+
This is the source of Mesimä (pronounced Mesi-mah). It is a RESTful HTTP application for task managment, written in Python.
4+
5+
Mesimä was created with ❤️ using [Django Rest Framework](https://www.django-rest-framework.org/) and [PostgreSQL](https://www.postgresql.org/).
6+
17
# Development Instructions
28

3-
To create the cluster, deploy and watch files:
9+
## Prerequisites
10+
11+
Running the app requires having tilt, k3d and their dependencies (Docker, kubectl...).
12+
13+
This project was developed using tilt `v0.23.4` and k3d `v5.2.2`.
14+
Newer version *should* be fine.
15+
16+
## Running the Application
17+
18+
Create a k3d cluster:
419

520
```s
621
$ k3d cluster create --config k3d.yaml
7-
$ kubectl apply -f https://raw.githubusercontent.com/reactive-tech/kubegres/v1.15/kubegres.yaml
8-
$ tilt up
922
```
1023

11-
To delete the cluster:
24+
Install Kubegres (a Kuberntes operator for delpoying PostgreSQL clustres):
1225

1326
```s
14-
$ k3d cluster delete amit-mini-project
27+
$ kubectl apply -f https://raw.githubusercontent.com/reactive-tech/kubegres/v1.15/kubegres.yaml
1528
```
1629

17-
## Running the Tests
18-
19-
Tests are easiest to run using sqlite. Use the following sequence of commands:
30+
Start the development setup:
2031

2132
```s
22-
$Env:DB="sqlite"
23-
poetry shell
24-
python manage.py test
33+
$ tilt up
2534
```
2635

27-
# DRF Useful Links
36+
Open a web broswer and navigate to `https://localhost:3080/api`. You should see DRF's browseable api client.
2837

29-
- A solution to the wierd API endpoinds in the form of `user/id/tasks` ([link](https://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/#refactoring-to-use-viewsets)).
30-
31-
- Writing 'raw' gin-like views in DRF ([link](https://www.django-rest-framework.org/tutorial/1-serialization/#writing-regular-django-views-using-our-serializer)).
32-
33-
- Overwrite just the post in the viewset which is prob the best move ([link](https://www.django-rest-framework.org/tutorial/quickstart/)).
38+
To delete the cluster:
3439

40+
```s
41+
$ k3d cluster delete amit-mini-project
42+
```
3543

44+
## Running the Tests
3645

37-
# Notes
46+
It is recommended to run the tests using sqlite, without k3d.
47+
This requires having `poetry` installed.
3848

39-
- `Post` returns data in headers. :(
40-
- `People` email field should be unique.
49+
Use the following sequence of commands to run the unit-tests:
4150

51+
```s
52+
$ cd backend
53+
$ poetry install # Install Python dependencies
54+
$ poetry shell # Spawn a shell inside the virtual environemnt
55+
$ cd manager
56+
$ DB="sqlite" python manage.py test # Run the test suite while using sqlite
57+
```
4258

43-
# Questions to Lecturer
59+
## Documentation
4460

45-
1. Can we return error messages in `JSON`? (There is a fix though (link)[https://www.django-rest-framework.org/api-guide/settings/#miscellaneous-settings]).
61+
The Django app and project were generated using `django create project` and `django create app` commands.
4662

63+
Consequentially, a basic understanding of Django's [getting started tutorial](https://docs.djangoproject.com/en/4.0/intro/tutorial01/) should be enough to understand the role of each source file.
4764

48-
# TODO
65+
To gain understanding of specific aspects of the app (e.g, routing), it is recommended to read the respective source files.
66+
DRF abstractions are heavily used, which allows most code to be self-documenting.
4967

50-
1. The weird nested endpoints (like `/tasks/id/owner`).
51-
2. Complete `Person`'s `activeTaskCount`.
68+
Usage of less common Django/DRF funcitonality is documented inline in each source file, with comments linking to Django documentation.

0 commit comments

Comments
 (0)