- What do you meme? This social media app is fun for everyone! Scroll through hundreds of memes and add your unique comments to them. Or create an account, upload your own meme, and get your friends to like and comment. Who can come up with the most original meme? You or me? It's You & Meme!
- Create an account
- User Authentication
- Post memes
- Comment & Like memes
- Delete memes & comments from your account
- Python
- Django
- Django REST Framework
- PostgreSQL
- SimpleJWT
Prerequisites:
- Python3
- pip
- virtualenvwrapper
Steps
- Clone this repository
git clone https://github.com/YourRepo/You-and-Meme-Backend.git
- Navigate to the project directory
cd You-and-Meme-Backend
- Create the virtual environment
virtualenv you_and_meme_backend
- If you've just created the virtual environment, it should be activated by default. If not, activate it
workon you_and_meme_backend
- Install the dependencies
pip install -r requirements.txt
- Run migrations
python manage.py migrate
- Create a superuser for the Django admin panel
python manage.py createsuperuser
- Run the server
python manage.py runserver
user
: OneToOneField (User)email
: EmailField (max_length=100)password
: CharField (max_length=100)likedPosts
: ArrayFieldavatar
: TextField
user
: ForeignKey (User)meme
: TextFieldlikes
: IntegerField (default=0)created
: DateTimeField (auto_now_add=True)updated_at
: DateTimeField (auto_now=True)
user
: ForeignKey (User)post
: ForeignKey (Post)body
: TextFieldcreated
: DateTimeField (auto_now_add=True)updated_at
: DateTimeField (auto_now=True)
id
= IntegerField(primary_key=True)name
= CharField(max_length=100)url
= TextFieldwidth
= IntegerFieldheight
= IntegerFieldbox_count
= IntegerField
- Using Django REST Framework's 'ModelViewSet,' each model is automatically outfitted with CRUD endpoints. However, several custom endpoints were created to handle many of the features.
Resource | Method | Endpoint | Description |
---|---|---|---|
Users | GET | /users/ |
List all users |
GET | /users/{id}/ |
Retrieve a single user | |
POST | /user/signup/ |
Create a new user | |
POST | /user/login/ |
Login user and return to token | |
PUT | /users/{id}/ |
Update a user's email | |
PUT | /users/{id}/update_username/ |
Update a user's username | |
PUT | /users/{id}/update_password/ |
Update a user's password | |
PUT | /users/{id}/add_to_liked_posts/ |
Update a user's liked posts | |
PUT | /users/{id}/remove_from_liked_posts/ |
Update a user's liked posts | |
DELETE | /users/{id}/ |
Delete a user | |
Posts | GET | /posts/ |
List all posts |
GET | /posts/{id}/ |
Retrieve a single post | |
POST | /posts/ |
Create a new post | |
PUT | /posts/{id}/ |
Update a post's likes | |
DELETE | /posts/{id}/ |
Delete a post | |
Comments | GET | /comments/ |
List all comments |
GET | /comments/{id}/ |
Retrieve a single comment | |
POST | /comments/ |
Create a new comment | |
DELETE | /comments/{id}/ |
Delete a comment | |
Memes | GET | /memes/ |
Get all meme templates |
GET | /memes/{id}/ |
Get one meme template |
- Contributors to this project include:
Manfred Joa | Rebekah Gomez | Dan Sinensky | Danish Mansoor | Kyle Harris | Alan Malpartida