- Route
/memes
: home page with list of memes - Route
/create
: page to create a meme (new or copy) for authenticated users (nb: in this application, users are creators, there is no admins or other types of users) - Route
/login
: login page
-
POST
/api/sessions
-
request body:
{ "username": "[email protected]", "password": "password" }
-
response:
200 OK
or401 Unauthorized
. -
response body: authenticated user info
{ "id": "1", "username": "[email protected]", "name": "ozerodb" }
-
-
DELETE
/api/sessions/current
- request parameters and request body: None
- response:
200 OK
or401 Unauthorized
. - response body: None
-
GET
/api/sessions/current
-
request parameters and request body: None
-
response:
200 OK
or401 Unauthorized
. -
response body: authenticated user info
{ "id": "1", "username": "[email protected]", "name": "ozerodb" }
-
-
GET
/api/memes
-
request parameters and request body: None
-
response:
200 OK
or500 Internal Server Error
-
response body: an array of memes
[{"id":21,"title":"This whole exam be like","creatorId":1,"creatorName":"ozerodb","templateId":4,"isPublic":1,"text1":"a fun and interesting exam","text2":"an hecc lot of memes","text3":"","color":"#FFFFFF","fontFamily":"Comic Neue, cursive"}, {"id":23,"title":"Oh no..","creatorId":3,"creatorName":"mario","templateId":3,"isPublic":1,"text1":"The exam went poorly","text2":"You scored a 10","text3":"It's out of 30","color":"#FF0000","fontFamily":"Arial, sans-serif"}, {"id":25,"title":"I love them","creatorId":2,"creatorName":"john","templateId":0,"isPublic":1,"text1":"Inline conditionals aren't less readable","text2":"","text3":"","color":"#0000FF","fontFamily":"Anton, sans-serif"}, {"id":26,"title":"Please don't do this to me","creatorId":2,"creatorName":"john","templateId":6,"isPublic":1,"text1":"accept a bad grade","text2":"","text3":"","color":"#FF00FF","fontFamily":"Comic Neue, cursive"}, {"id":29,"title":"It's difficult being old","creatorId":3,"creatorName":"mario","templateId":6,"isPublic":1,"text1":"stop doing all-nighters before every exam","text2":"","text3":"","color":"#FF0000","fontFamily":"Comic Neue, cursive"}, {"id":30,"title":"LESSSGOOOOO","creatorId":1,"creatorName":"ozerodb","templateId":1,"isPublic":1,"text1":"It's coming home","text2":"It's coming Rome","text3":"","color":"#000000","fontFamily":"Arial, sans-serif"}, {"id":32,"title":"Not once, twice :l","creatorId":1,"creatorName":"ozerodb","templateId":3,"isPublic":1,"text1":"you have an exam tomorrow","text2":"you studied a lot and you feel confident in your preparation","text3":"you forgot to book for it","color":"#000000","fontFamily":"Arial, sans-serif"}]
-
-
DELETE
/api/memes/:id
- request parameter: meme's id
- response:
200 OK
or401 Unauthorized
or500 Internal Server Error
- response body: None
-
POST
/api/new_meme
- request body: a meme object
{"title":"Example","creatorId":1,"creatorName":"ozerodb","templateId":0,"isPublic":1,"text1":"You can't change my mind","text2":"","text3":"","color":"#000000","fontFamily":"Anton, sans-serif"},
- response:
200 OK
or401 Unauthorized
or500 Internal Server Error
- response body: None
- Table
users
- contains users'id
,name
,email
,password
(hashed) - Table
memes
- contains memes'id
,title
,creatorId
,templateId
,isPublic
,text1
,text2
,text3
,color
,fontFamily
Meme
(inmeme.js
): this component takes as props the info about a meme (including the template info) and returns an image with overlaid texts.MemeModal
(inmeme.js
): this component takes as props the info about a meme (including the template info) and returns aModal
with aMeme
component inside.MemesList
(inmeme.js
): this component takes as props an array of memes' info, and the info about the current user. It returns a list of items including the meme's title and creator, and if the user is authenticated it includes the meme's visibility and the utility buttons.MemeCreator
(inmeme.js
): this component takes as props an array of templates, and the info about the current user. It returns aModal
consisting of aMeme
component on the left, to be used as a preview, and aForm
on the right, to be used as an editor to modify the meme. If thelocation.prefill
hook is defined, theMemeCreator
works in copy mode.
[email protected]
,password
- This whole exam be like (public)
- Dissing (protected)
- Professionals have standards (protected)
- LESSSGOOOOO (public)
- Not once, twice :l (public)
[email protected]
,password
- I love them (public)
- Please don't do this to me (public)
- Facts (protected)
[email protected]
,password
- Oh no.. (public)
- Professionals have standards (protected)
- It's difficult being old (public)
- I'm not an Apple fanboy but (protected)
(Yes, the password is password
for all of them)