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