![](https://private-user-images.githubusercontent.com/65015373/238193541-8aad2e6e-3f5b-4e0e-979f-a7b3a0cfc99c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODUwMjYsIm5iZiI6MTczOTI4NDcyNiwicGF0aCI6Ii82NTAxNTM3My8yMzgxOTM1NDEtOGFhZDJlNmUtM2Y1Yi00ZTBlLTk3OWYtYTdiM2EwY2ZjOTljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE0Mzg0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5NGE3ZTg5NzVmYzc5NWQzZTczODZjMjYyNGI0YTBiNmM1NGIyNzBkYzk3MTAxOWI1N2I2MjA4YmZkY2U2ZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.KTZ5Td2RJXbz3WpneFbzwB0gnmYlcMI865JWId2rlIE)
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
.