As a university student, I always wish if I could know how the course I want to register looks and professor's reputation so that I could make the best decision in terms of choosing elective courses / professors. That is why I created this app by adding features that I thought would be nice to have. Besides that, I have learned React in University and wanted to integrate it with Django.
After user authorization, each user can make a thread and rate school/faculty/class/professor between 1 to 5 and write its reputations. Another user basically can find a thread in main timeline or using filter. They also can write comment in its theread as well.
- Mac OS
- Atom (IED)
- Django & Django Rest Framework
- Swagger
- Python 3.11.0 venv
- React
- Bootstrap
API | endpoint | HTTP Method | Description |
---|---|---|---|
USER API | /user/create |
POST | register a new user |
/user/token |
POST | create a new token | |
/user/me |
GET | get a profile | |
PUT / PATCH | update a profile | ||
POST API | /post/ |
GET | list all posts (+ filter function) |
POST | create a post | ||
/post/<id> |
GET | view details of post | |
PUT / PATCH | update a post | ||
DELETE | delete a post | ||
COMMENT API | /post/<id>/comment |
GET | list all comments in the post |
CREATE | create a new comment in the post | ||
/post/<id>/comment/<comment_id> |
GET | get the certain comment in the post | |
PUT | update the certain comment in the post | ||
DELETE | delete the certain comment in the post |
# activate virtual env (mac)
$ source env/bin/activate
# or install requirments.txt
$ pip install -r requirements.txt
# run server
$ python manage.py runserver
# run test
$ python manage.py test
Then, go to http://127.0.0.1:8000/api/docs#/
-
Create User
-
Token Auth
-
Make a post
(Auth user only can edit and delete his own post)
4. Make a comment 1. Open `POST api/post/{id}/comment/`, pass post id, fill in the required info for a comment, and execute. ![Screen Shot 2023-12-30 at 18 33 28](https://github.com/seita-f/Grading-Board-DRF-React/assets/128184233/01d3d8a9-1f28-4d28-ae86-61c3d6403fe1)
2. We can check all comments in a certain post by executing `GET api/post/{id}/comment`
(Auth user only can fix and delete his own comment)
Seita Fujiwara 2023