Basic Tiktok clone
- Visitors can only view Post
- User can login or signup
- User can create Posts and Comments
- Post has Comments
conda create --name toktik
conda activate toktik
conda install python=3.10 pip
pip install uvicorn fastapi==0.100.0 SQLAlchemy pyjwt passlib psycopg2 hashlib
conda activate toktik
uvicorn api.src.main:app --reload
Post
GET
/post/:id
(get 1 Post)
name |
type |
data type |
description |
id |
required |
int |
post_id |
http code |
content-type |
response |
200 |
application/json |
Post |
404 |
application/json |
Post does not exist |
GET
/post/random
(get a random Post)
http code |
content-type |
response |
200 |
application/json |
Post |
GET
/post/list
(get all Posts)
http code |
content-type |
response |
200 |
application/json |
Post |
POST
/post/create
(create a new Post)
name |
type |
data type |
description |
title |
required |
str |
Title of Post |
description |
optional |
str |
Description of Post |
video_url |
required |
str |
URL of embedded video |
user_id |
required |
int |
ID of author |
http code |
content-type |
response |
200 |
application/json |
Post |
DELETE
/post/delete/:id
(Delete a Post)
http code |
content-type |
response |
200 |
application/json |
Post |
404 |
application/json |
Post does not exist |
PATCH
/post/update/:id
(Partially update an existing Post)
name |
type |
data type |
description |
title |
optional |
str |
Title of Post |
description |
optional |
str |
Description of Post |
http code |
content-type |
response |
200 |
application/json |
Post |
404 |
application/json |
Post does not exist |
Comment
GET
/comment/:id
(get 1 Comment)
name |
type |
data type |
description |
id |
required |
int |
comment_id |
http code |
content-type |
response |
200 |
application/json |
Comment |
404 |
application/json |
Comment does not exist |
GET
/comment/list
(get all Comments)
http code |
content-type |
response |
200 |
application/json |
Comment |
COMMENT
/comment/create
(create a new Comment)
name |
type |
data type |
description |
content |
required |
str |
Actual comment |
author_id |
required |
str |
Author of comment |
post_id |
required |
str |
Post the comment was made on |
http code |
content-type |
response |
200 |
application/json |
Comment |
DELETE
/comment/delete/:id
(Delete a Comment)
http code |
content-type |
response |
200 |
application/json |
Comment |
404 |
application/json |
Comment does not exist |
PATCH
/comment/update/:id
(Partially update an existing Comment)
name |
type |
data type |
description |
content |
optional |
str |
Actual comment |
http code |
content-type |
response |
200 |
application/json |
Comment |
404 |
application/json |
Comment does not exist |