Skip to content

ShahbaazX786/Todo-List-EJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo List App V3 (MEEN stack)

Made with HTML, CSS, Javascript, Node, ExpressJS, and EJS(Embedded Javascript). inshort MEEN stack lol.

  • M --> MongoDB
  • E --> ExpressJS
  • E --> EJS
  • N --> NodeJS

Note: Link available only upto November 2022 due to heroku free tier decesions.

EJS

EJS is a templating language which partitions our heavy html websites into smaller chunks/components(EJS files) which can be later loaded as templates dynamically (similar to modern frameworks like angular).

  • We can reuse code as templates (by using partitions/layouts).

  • We can reduce complexity thereby making it easier to debug.

  • We can reduce code size.

  • Simple syntax.

  • We have to use scriplets(<% %>) only when we are using conditional statements(if,else,for,while,do-while etc).

  • Can pass data from server(app.js) to view(index.ejs) via (<%= variable-name %>) and res.render("index",variable-name:"Hello Boii") by using get method and redirecting to home route('/').

  • Can pass data from view(index.ejs) to server(app.js) via form(in index.ejs) and post method(in app.js).

Important rules:

  • We must place all our ejs files in view folder else you'll face error.
  • We must set the view engine to ejs in express file(app.js). Using :app.set("view engine", "ejs");
  • Place all the static files like styles.css, assets(images, icons, svgs etc) in a public folder and serve those files aswell with your express server(app.js) to get the styles applied correctly. Using:app.use(express.static("public"));

1. Home List Page

Screenshot-1

2. Adding tasks to list

Screenshot-2

3. Work List

Screenshot-3

4. Get Day function using an exported module

Screenshot-4

PS: You are free to contribute to this project via a PR.

5. Using MongoDB for persistent storage

Used MongoDB atlas free tier to host our database and also to manage data need.(Adding,deleting the tasks from the list also maintaining other dynamic routing pages.) Screenshot-5

6. Using Heroku for server(nodejs app)

Used Heroku to host our node app (server environment) which returns response when we send some requests to our app. Screenshot-6

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published