i-tweet is a twitter clone. It is a full-stack web application with a RESTful API backend using React, Redux, JavaScript, CSS, HTML, Python and more.
- Create an account, login, logout, and login with a Demo account.
- Create, edit, and delete tweets.
- Create, edit, and delete replies.
- Like and unlike tweets.
- View feed, profile, and other users' profiles.
- Upload images for a profile picture when signing up
- Upload images when creating and editing a tweet
- Docker
- React
- Redux
- Python
- Flask
- SQLAlchemy
- PostgreSQL
- AWS S3
- HTML
- CSS
- JavaScript
- Clone the repo and run
pipenv installto install the dependencies - Create .env file, for example:
SECRET_KEY=[add secret key here] DATABASE_URL=sqlite:///dev.db - Start pipenv shell
pipenv shell - Migrate and seed database
flask db migrateandflask seed all - Run flask
flask run - cd into the
react-app - run
npm installto install the frontend dependencies - run
npm startto start the frontend - go to localhost:3000 in your browser
Prepend all routes below with /api
POST credentials for authentication
POST create new user
DELETE user session
GET my tweets
GET my replies
Require Authentication: TRUE
Request Body: N/A
Response Body Status Code: 200
Require Authentication: TRUE
{
"Tweets" :
[
{
"id": 1,
"userId": 1,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
},
{
"id": 2,
"userId": 1,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
]
}
GET my Comments
Require Authentication: TRUE
Request Body: N/A
Response Body
Status Code: 200
Require Authentication: TRUE
{
"Comments" :
[
{
"id": 1,
"userId": 1,
"username": "demo",
"tweetId":1,
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
},
{
"id": 2,
"userId": 1,
"username": "demo",
"tweetId":1,
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
]
}
GET all tweets
Require Authentication: TRUE
Request Body: N/A
Response Body
Status Code: 200
{
"Tweets" :
[
{
"id": 1,
"userId": 1,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
"Likes" :
{
total: 3
iLiked: False
},
"totalComments" : 7
},
{
"id": 2,
"userId": 2,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
"Likes" :
{
total: 3
iLiked: False
},
"totalComments" : 7
}
]
}
POST a new tweet
Require Authentication: TRUE
Request Body
{
"body": "Sample Body"
}
Response Body
Status Code: 201
{
"id": 2,
"userId": 2,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
GET a specific tweet and it's associated comments, and cumulative likes
Require Authentication: TRUE
Response Body
Status Code: 200
{
"Tweets" :
{
"id": 1,
"userId": 1,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12",
"Likes" :
{
total: 3
iLiked: False
},
"Comments" :
[
{
"id": 1,
"userId": 1,
"username": "demo",
"tweetId":1,
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12",
}
]
}
}
PUT to update a specific tweet
Require Authentication: TRUE
Request Body
{
"body": "Sample Body"
}
Response Body
Status Code: 200
Require Authentication: TRUE
{
"id": 2,
"userId": 2,
"username": "demo",
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
DELETE a specific tweet
Require Authentication: TRUE
Request Body: N/A
Response Body
Status Code: 200
{
"message": "Successfully deleted",
"Status Code": 200
}
POST a new comment
Require Authentication: TRUE
Request Body
{
"body": "Sample Body"
}
Response Body
Status Code: 201
{
"id": 2,
"userId": 2,
"username": "demo",
"tweetId": 1,
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
PUT to update a specific comment
Require Authentication: TRUE
Request Body
{
"body": "Sample Body"
}
Response Body
Status Code: 200
{
"id": 2,
"userId": 2,
"username": "demo",
"tweetId": 1,
"body": "Sample Body",
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
DELETE a specific comment
Require Authentication: TRUE
Request Body N/A
Response Body
Status Code: 200
{
"message": "Delete Successfully",
"Status Code": 200
}
POST a new like
Require Authentication: TRUE
Request Body
{
"body": "like"
}
Response Body
Status Code: 200
{
"id": 2,
"userId": 2,
"username": "demo",
"tweetId": 1,
"created_on": "2022-12-12",
"last_update_on": "2022-12-12"
}
DELETE a specific like
Require Authentication: TRUE
Request Body N/A
Response Body Status Code: 200
{
"message": "Delete Successfully",
"Status Code": 200
}
POST a new follow for the current user on a specific user
Require Authentication: TRUE
Request Body
{
"follow": 'Y'
}
Response Body
Status Code: 200
{
"id": 2,
"userId": 2,
"answerId": 1,
"voteDirection": "Down"
}
DELETE a specific follow
Require Authentication: TRUE
Request Body: N/A
Response Body
Status Code: 200
{
"message": "Successfully deleted",
"Status Code": 200
}


