Skip to content

chrismenke45/twitter-api

Repository files navigation

Twitter Clone Backend

This is the backend to the twitter clone made with Node.js/Express.js and MongoDB: desktop

How it's made:

Tech used: Node.js, Express.js, MongoDB, Twitter OAuth
Twitter OAuth was used to authenticate users and prepopulate their account. It was tested with postman before being integrated with the frontend.

Optimizations

There is a lot I'd change about this site if I started from scratch again. I am currently storing all images in binary blobs within my MongoDB database. This is not only slow, but also would be very expensive if the site were to scale. Instead I would store my images in an imagestore such as cloudinary or google firestore. I also should have set up the database schema to not double store data. Currently, user models store a list of all their following and followers. I should have just stored following and made a query for followers whenevever it was needed.

Lessons learned

This project taught me about cors and how it affects frontend and backends hosted at different domains. It made working with cookies hard, so I opted for stateless JWT auth instead of session based auth with cookies.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages