Designing our web app
Last updated
Last updated
The design phase is the most important in any software project as one small mistake in designing becomes very costly to fix that later. In most projects, there are a few solutions applied to mistakes in design, they are just glued together until it becomes impossible to go forward. The term is called technical debt.
Our webapp is going to be a todo list manager for multiple users. It'll have the following features:
Translating our design to API, we get the following.
file ~/main/main.go
Create all functions we mentioned above and make the necessary changes as per one definition that we show below in this file.
After you create these functions run the server as below,
In your browser type localhost:8080
and type all these URLs and see what message you get.
Check the documentation for http.ResponseWriter
and http.Request
objects and get to know all the variables/functions/constants for http package and these two which we mentioned.
URL
Method
Description
/add/
POST
add new task
/
GET
show pending tasks
/complete/
GET
show completed tasks
/deleted/
GET
show deleted tasks
/edit/
POST
edit post
/edit/
GET
show the edit page
/trash/
POST
trash post to recycle bin
/delete/
POST
permanently delete post
/complete/
POST
mark post as complete
/login/
POST
do the login
/login/
GET
show login page
/logout/
POST
log the user out
/restore/
POST
restore that task
/update/
POST
update task
/change/
GET
will allow changing password
/register/
GET
show the register page
/register/
POST
will add entries into database