This project is a template for a simply social media website built using:
Create an account and the post! Search for your friends and see the lattest photo.
For login sessions I saved the user's id in cookies. I also implemented a middleware that checks if you are curently logged in and if not redirects you to the sign in page.
The users along with their posts are saved locally in a 2 json files.
All the front-end stuffs are located in views folder.
The structure for every view has the following structure:
- view.ejs - contains the content that needs to be randered for the client.
- view.js - is the router used to handle the
/view
route. - views.cjs - contains functions only used for that specific
.ejs
file. - /public/view.js - will contains the code that runs on the front-end of the page.
All the files from above are located in the same directory view
.