From 42280f6cc1cea9946d3430de70c939ccc7692291 Mon Sep 17 00:00:00 2001 From: charlie roberts Date: Mon, 7 Sep 2020 10:34:42 -0400 Subject: [PATCH 01/14] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 304a16f1..b5f0d390 100755 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ Assignment 2 - Short Stack: Basic Two-tier Web Application using HTML/CSS/JS and Node.js === -Due: September 9th, by 11:59 AM. +Due: September 16th, by 11:59 AM. This assignment aims to introduce you to the concepts and practice involved in creating a prototype (i.e. not deployment ready) two-tiered web application. The baseline aims of this assignment involve creating an application that demonstrates the use of several specific pieces of HTML, CSS, JavaScript, and Node.js functionality. -Another aim of this assignment is to establish creative boundaries in which you and your partner can explore designing, implementing, and evaluating usable, useful, novel, and technically efficient web applications. Baseline Requirements --- @@ -30,7 +29,7 @@ Your application is required to demonstrate the use of the following concepts: HTML: - One or more [HTML Forms](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms), with any combination of form tags appropriate for the user input portion of the application - - Clarification: the results page can be implemented in any way. `
`s, `table`s, and `list`s are common choices +- A results page displaying all data currently available on the server. You will most likely use a `` tag for this, but `
` tag for this, but ` - diff --git a/server.improved.js b/server.improved.js index ef0de95f..b7737ae3 100644 --- a/server.improved.js +++ b/server.improved.js @@ -54,8 +54,16 @@ function buildPage(){ toReturn += "
Admin Status Date added Delete
"; toReturn += ` ` @@ -79,24 +87,43 @@ const handleGet = function( request, response ) { } const handlePost = function( request, response ) { - let dataString = '' - - request.on( 'data', function( data ) { - dataString += data - }) - - request.on( 'end', function() { - let data = JSON.parse(dataString); - wasLastAnAdmin = data.admin; - let dateAdded = new Date(); - dateAdded = `${dateAdded.getFullYear()}-${dateAdded.getMonth()}-${dateAdded.getDate()}-${dateAdded.getHours()}-${dateAdded.getMinutes()}`; - data.dateAdded = dateAdded; - data.id = appdata[appdata.length - 1].id + 1; - console.log(data.id); - appdata.push(data); - response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); - response.end(); - }) + if( request.url === '/delete' ) { + console.log('hit') + let toDelete = null; + + request.on('data', function( data ) { + toDelete = data; + console.log(toDelete); + }); + + request.on('end', function(){ + appdata.filter(function(val){ + return val.id !== toDelete; + }) + }) + + } else { + let dataString = '' + + request.on( 'data', function( data ) { + dataString += data + }) + console.log('hi') + console.log(request.header) + request.on( 'end', function() { + let data = JSON.parse(dataString); + wasLastAnAdmin = data.admin; + let dateAdded = new Date(); + dateAdded = `${dateAdded.getFullYear()}-${dateAdded.getMonth()}-${dateAdded.getDate()} ${dateAdded.getHours()}:${dateAdded.getMinutes()}`; + data.dateAdded = dateAdded; + data.id = parseInt(appdata[appdata.length - 1].id) + 1; + console.log(data.id); + appdata.push(data); + + }) + } + response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); + response.end(); } const sendFile = function( response, filename ) { From ce210995787b96b2dabee6acc9a54fe257cf4050 Mon Sep 17 00:00:00 2001 From: charlie roberts Date: Tue, 8 Sep 2020 15:40:59 -0400 Subject: [PATCH 06/14] Update README.md --- README.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 642c55c4..3945c152 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Assignment 2 - Short Stack: Basic Two-tier Web Application using HTML/CSS/JS and Node.js === -Due: September 16th, by 11:59 AM. +Due: September 16th, by 11:59 PM. This assignment aims to introduce you to the concepts and practice involved in creating a prototype (i.e. not deployment ready) two-tiered web application. The baseline aims of this assignment involve creating an application that demonstrates the use of several specific pieces of HTML, CSS, JavaScript, and Node.js functionality. @@ -48,22 +48,38 @@ Deliverables Do the following to complete this assignment and acheive a base grade of 85%: -1. Fork the starting project code. This repo contains some starter code that may be used or discarded as needed. +1. Fork the starting project code (make sure to fork the 2020 repo!). This repo contains some starter code that may be used or discarded as needed. 2. Implement your project with the above requirements. 3. Test your project to make sure that when someone goes to your main page, it displays correctly. 4. Deploy your project to Glitch, and fill in the appropriate fields in your package.json file. 5. Ensure that your project has the proper naming scheme `a2-yourname` so we can find it. -6. Modify the Readme to the specifications below. +6. Modify the README to the specifications below. 7. Create and submit a Pull Request to the original repo. Label the pull request as follows: a2-gitusername-firstname-lastname Acheivements --- -Below are some suggested technical and design achievements. You can use these to help boost your grade up to an A and customize the assignment to your personal interests. These are recommended acheivements, but feel free to create/implement your own... just make sure you thoroughly describe what you did in your README and why it was challenging. ALL ACHIEVEMENTS MUST BE DESCRIBED IN YOUR README IN ORDER TO GET CREDIT FOR THEM. +Below are suggested technical and design achievements. You can use these to help boost your grade up to an A and customize the assignment to your personal interests. These are recommended acheivements, but feel free to create/implement your own... just make sure you thoroughly describe what you did in your README and why it was challenging. ALL ACHIEVEMENTS MUST BE DESCRIBED IN YOUR README IN ORDER TO GET CREDIT FOR THEM. *Technical* - (10 points) Create a single-page app that both provides a form for users to submit data and always shows the current state of the server-side data. To put it another way, when the user submits data, the server should respond sending back the updated data (including the derived field calculated on the server) and the client should then update its data display. +*Design/UX* +- (5 points per person, with a max of 10 points) Test your user interface with other students in the class. Define a specific task for them to complete (ideally something short that takes <10 minutes), and then use the [think-aloud protocol](https://en.wikipedia.org/wiki/Think_aloud_protocol) to obtain feedback on your design (talk-aloud is also find). Important considerations when designing your study: + +1. Make sure you start the study by clearly stating the task that you expect your user to accomplish. +2. You shouldn't provide any verbal instructions on how to use your interface / accomplish the task you give them. Make sure that your interface is clear enough that users can figure it out without any instruction, or provide text instructions from within the interface itself. +3. If users get stuck to the point where they give up, you can then provde instruction so that the study can continue, but make sure to discuss this in your README. You won't lose any points for this... all feedback is good feedback! + +You'll need to use sometype of collaborative software that will enable you both to see the test subject's screen and listen to their voice as they describe their thoughts. After completing each study, briefly (one to two sentences for each question) address the following in your README: + +1. Provide the last name of each student you conduct the evaluation with. +2. What problems did the user have with your design? +3. What comments did they make that surprised you? +4. What would you change about the interface based on their feedback? + +*You do not need to actually make changes based on their feedback*. This acheivement is designed to help gain experience testing user interfaces. If you run two user studies, you should answer two sets of questions. + Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions) --- @@ -72,8 +88,6 @@ Include a very brief summary of your project here. Be sure to include the CSS po ## Technical Achievements - **Tech Achievement 1**: Using a combination of... -- **Tech Achievement 2**: ... ### Design/Evaluation Achievements -- **Design Achievement 1**: Shown in `style.css`, the code... -- **Design Achievement 2**: We tested the application with n=X users, finding that... +- **Design Achievement 1**: From c086022014f6626d65c9c9ae4ad922071aa35614 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Tue, 8 Sep 2020 20:09:42 -0700 Subject: [PATCH 07/14] backup --- public/css/style.css | 10 +++++++++ public/results.html | 2 ++ server.improved.js | 51 +++++++++++++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 8b9215c7..fdfbda85 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,6 +1,7 @@ /*Style your own assignment! This is fun! */ .hidden{ color:red; + font-family: 'Courier New', Courier, monospace; } th{ @@ -13,9 +14,18 @@ body, button, ::placeholder{ font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } +table { + display: flex; + justify-content: center; +} + input{ width: 500px; height: 30px; font-size: 28px; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; +} + +#Title{ + text-align: center; } \ No newline at end of file diff --git a/public/results.html b/public/results.html index b5dfcf96..9442ba3b 100644 --- a/public/results.html +++ b/public/results.html @@ -7,8 +7,10 @@ Users Page +

Users Table

+ diff --git a/server.improved.js b/server.improved.js index b7737ae3..20ebd041 100644 --- a/server.improved.js +++ b/server.improved.js @@ -6,9 +6,9 @@ const http = require( 'http' ), dir = 'public/', port = 3000 -const appdata = [ - {id: 0, username: "tRits", password: "password" , ssn : "123456789", admin: false, dateAdded: '1991-8-21'}, - {id: 1, username: "n0Passw0rdMan123", password: "password123" , ssn : "987654321", admin: false, dateAdded: '2000-2-24'} +let appdata = [ + {id: 0, username: "tRits", password: "password" , ssn : "123456789", admin: false, dateAdded: '1991-8-21', nick: 'R'}, + {id: 1, username: "n0Passw0rdMan123", password: "password123" , ssn : "987654321", admin: false, dateAdded: '2000-2-24', nick: 'PM'} ]; let wasLastAnAdmin = false; @@ -31,6 +31,7 @@ function buildPage(){ if (wasLastAnAdmin === true){ appdata.forEach(function(item){ toReturn += ` + @@ -42,6 +43,7 @@ function buildPage(){ } else { appdata.forEach(function(item, idx){ toReturn += ` + @@ -61,10 +63,14 @@ function buildPage(){ body: JSON.stringify({id: id}) }) .then( function( response ) { - console.log( response ) - console.log( response.body) + if (response.status === 200){ + alert("Successfully removed"); + item.remove(); + } else { + alert("Was not removed successfully, try again"); + } + }) - item.remove(); } ` toReturn += "" @@ -88,16 +94,15 @@ const handleGet = function( request, response ) { const handlePost = function( request, response ) { if( request.url === '/delete' ) { - console.log('hit') - let toDelete = null; + let toDelete = ''; request.on('data', function( data ) { - toDelete = data; - console.log(toDelete); + toDelete += data; + toDelete = JSON.parse(toDelete).id; }); request.on('end', function(){ - appdata.filter(function(val){ + appdata = appdata.filter(function(val){ return val.id !== toDelete; }) }) @@ -108,16 +113,32 @@ const handlePost = function( request, response ) { request.on( 'data', function( data ) { dataString += data }) - console.log('hi') - console.log(request.header) request.on( 'end', function() { let data = JSON.parse(dataString); wasLastAnAdmin = data.admin; let dateAdded = new Date(); dateAdded = `${dateAdded.getFullYear()}-${dateAdded.getMonth()}-${dateAdded.getDate()} ${dateAdded.getHours()}:${dateAdded.getMinutes()}`; data.dateAdded = dateAdded; - data.id = parseInt(appdata[appdata.length - 1].id) + 1; - console.log(data.id); + let upperCase = ''; + for (let i = 0; i < data.username.length; i++){ + if (data.username.charAt(i) === data.username.charAt(i).toUpperCase()){ + upperCase += data.username.charAt(i); + } + } + if (upperCase.length > 0){ + data.nick = upperCase; + } else{ + if (data.username.length === 0){ + data.nick = 'Blank'; + } else { + data.nick = data.username.charAt(0); + } + } + if (appdata.length === 0){ + data.id = 0 + } else { + data.id = parseInt(appdata[appdata.length - 1].id) + 1; + } appdata.push(data); }) From a821ac9ae3efb947ada695480cd57fdffa46b256 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Wed, 9 Sep 2020 17:56:07 -0700 Subject: [PATCH 08/14] backup --- public/css/style.css | 12 ++++++++++-- public/index.html | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index fdfbda85..dd4171c6 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -12,20 +12,28 @@ th{ body, button, ::placeholder{ font-size: 28px; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + display:flex; + justify-content: center; + align-items: center; + flex-direction:column } table { display: flex; - justify-content: center; + justify-content: space-around; } -input{ +input[type = text]{ width: 500px; height: 30px; font-size: 28px; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } +input[type = checkbox]{ + width: 30px; + height: 30px; +} #Title{ text-align: center; } \ No newline at end of file diff --git a/public/index.html b/public/index.html index 749f8303..748398c9 100755 --- a/public/index.html +++ b/public/index.html @@ -6,21 +6,22 @@ +

User Entry

+


- +
` toReturn += "" return toReturn; From 3de3450424ac2cb417005d474939e16f40cd0831 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Thu, 10 Sep 2020 17:38:29 -0700 Subject: [PATCH 10/14] added fetching instead of server side build --- public/css/style.css | 8 +++- public/results.html | 98 ++++++++++++++++++++++++++++++++++---------- server.improved.js | 93 +++++++++++++++-------------------------- 3 files changed, 116 insertions(+), 83 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 9ab65007..c2706b48 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,12 +1,16 @@ /*Style your own assignment! This is fun! */ .hidden{ color:red; - font-family: 'Courier New', Courier, monospace; } -th{ +table{ + border-collapse: collapse; +} + +tr, td, th{ border:solid; border-width: 2px; + border-color: black; } body, button, ::placeholder{ diff --git a/public/results.html b/public/results.html index b6e94006..d50c5005 100644 --- a/public/results.html +++ b/public/results.html @@ -1,24 +1,78 @@ - - - - - Users Page - - - -

Users Table

-
Nickname Username Password SSN
${item.nick} ${item.username} ${item.password}
${item.nick} ${item.username}
- - - - - - - - - + + + + + Users Page + + + +

Users Table

+
NicknameUsernamePasswordSSNAdmin StatusDate addedDelete
+ + + + + + + + + +
NicknameUsernamePasswordSSNAdmin StatusDate addedDelete
+ + + + + diff --git a/server.improved.js b/server.improved.js index 66635ccb..7010a125 100644 --- a/server.improved.js +++ b/server.improved.js @@ -7,7 +7,7 @@ const http = require( 'http' ), port = 3000 let appdata = [ - {id: 0, username: "tRits", password: "password" , ssn : "123456789", admin: false, dateAdded: '1991-8-21', nick: 'R'}, + {id: 0, username: "Test", password: "password" , ssn : "123456789", admin: false, dateAdded: '1991-8-21', nick: 'T'}, {id: 1, username: "n0Passw0rdMan123", password: "password123" , ssn : "987654321", admin: false, dateAdded: '2000-2-24', nick: 'PM'} ]; @@ -32,66 +32,14 @@ const server = http.createServer( function( request,response ) { } }) -function buildPage(){ - let toReturn = resultsPage; - if (wasLastAnAdmin === true){ - appdata.forEach(function(item){ - toReturn += ` - ${item.nick} - ${item.username} - ${item.password} - HIDDEN - ${item.admin} - ${item.dateAdded} - - ` - }); - } else { - appdata.forEach(function(item, idx){ - toReturn += ` - ${item.nick} - ${item.username} - HIDDEN - HIDDEN - ${item.admin} - ${item.dateAdded} - - ` - }); - } - - toReturn += ""; - toReturn += ` ` - toReturn += "" - return toReturn; -} const handleGet = function( request, response ) { const filename = dir + request.url.slice( 1 ) - if( request.url === '/' ) { sendFile( response, 'public/index.html' ); }else if (request.url === '/users'){ - response.writeHeader( 200, { 'Content-Type': 'text/html' }) - response.end( buildPage() ) + sendFile( response, 'public/results.html' ); }else if (request.url === '/style.css') { sendFile( response, 'public/css/style.css'); }else{ @@ -112,8 +60,34 @@ const handlePost = function( request, response ) { appdata = appdata.filter(function(val){ return val.id !== toDelete; }) - }) - + }); + response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); + response.end(); + } else if (request.url === '/userList'){ + let redactedData = []; + if (wasLastAnAdmin){ + appdata.forEach(function(element){ + redactedData.push({id: element.id, + username: element.username, + password: element.password , + ssn : -1, + admin: element.admin, + dateAdded: element.dateAdded, + nick: element.nick}) + }); + } else { + appdata.forEach(function(element){ + redactedData.push({id: element.id, + username: element.username, + password: -1 , + ssn : -1, + admin: element.admin, + dateAdded: element.dateAdded, + nick: element.nick}) + }); + } + response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); + response.end(JSON.stringify(redactedData)); } else { let dataString = '' @@ -148,10 +122,11 @@ const handlePost = function( request, response ) { } appdata.push(data); - }) + }) + response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); + response.end(); } - response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); - response.end(); + } const sendFile = function( response, filename ) { From f7fe5b4ebfad5f9c76be5572656ff5b0279b0568 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Fri, 11 Sep 2020 09:04:23 -0700 Subject: [PATCH 11/14] localstoring the nickname --- public/css/style.css | 8 +++--- public/index.html | 31 +++++++++++++++-------- public/js/scripts.js | 11 +++++--- public/results.html | 12 ++++++++- server.improved.js | 60 +++++++++++++++++++++----------------------- 5 files changed, 74 insertions(+), 48 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index c2706b48..d9483490 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -48,11 +48,13 @@ input[type = checkbox]{ display: flex; justify-content: space-around; font-size: 36px; - width: 100%; - padding: 5px - + width: 100%; + padding-top: 5px; + padding-bottom: 5px; } + + a { color: black; } diff --git a/public/index.html b/public/index.html index 7dfda194..459fccec 100755 --- a/public/index.html +++ b/public/index.html @@ -4,11 +4,13 @@ User Entry +

User Entry

@@ -44,14 +46,18 @@

User Entry

method:'POST', body : body }) - .then( function( response ) { - if(response.ok){ - alert("Successfully added user"); - let userLink = document.getElementById('userList'); - userLink.classList.add('glow'); - } else { - alert("Error in adding user"); - } + .then(function(response){ + console.log(response) + return response.text() + }) + .then( function( nick ) { + console.log(nick) + alert("Successfully added user"); + let userLink = document.getElementById('userList'); + userLink.classList.add('glow'); + localStorage.setItem('nick', nick); + let greeting = document.getElementById('headerGreeting'); + greeting.innerText = `Hello ${nick}`; }) return false; @@ -59,8 +65,13 @@

User Entry

window.onload = function() { const button = document.querySelector( 'button' ) - button.onclick = submit - } + button.onclick = submit; + let greeting = document.getElementById('headerGreeting'); + let name = localStorage.getItem('nick') + if (name !== null){ + greeting.innerText = `Hello ${name}`; + } +} diff --git a/public/js/scripts.js b/public/js/scripts.js index de052eae..cc1c9d3d 100755 --- a/public/js/scripts.js +++ b/public/js/scripts.js @@ -1,3 +1,8 @@ -// Add some Javascript code here, to run on the front end. - -console.log("Welcome to assignment 2!") \ No newline at end of file +window.onload = setGreeting; +function setGreeting(){ + let greeting = document.getElementById('headerGreeting'); + let name = localStorage.getItem('nick') + if (name !== null){ + greeting.innerText = `Hello ${name}`; + } +} \ No newline at end of file diff --git a/public/results.html b/public/results.html index d50c5005..eab62133 100644 --- a/public/results.html +++ b/public/results.html @@ -4,12 +4,14 @@ + Users Page

Users Table

@@ -71,7 +73,15 @@

Users Table

}); }) } - reqUsers() + reqUsers(); + window.onload = setGreeting; + function setGreeting(){ + let greeting = document.getElementById('headerGreeting'); + let name = localStorage.getItem('nick') + if (name !== null){ + greeting.innerText = `Hello ${name}`; + } + } diff --git a/server.improved.js b/server.improved.js index 7010a125..e671c87f 100644 --- a/server.improved.js +++ b/server.improved.js @@ -89,42 +89,40 @@ const handlePost = function( request, response ) { response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); response.end(JSON.stringify(redactedData)); } else { - let dataString = '' - + let dataString = ''; + let nick = ''; request.on( 'data', function( data ) { - dataString += data - }) - request.on( 'end', function() { - let data = JSON.parse(dataString); - wasLastAnAdmin = data.admin; - let dateAdded = new Date(); - dateAdded = `${dateAdded.getFullYear()}-${dateAdded.getMonth()}-${dateAdded.getDate()} ${dateAdded.getHours()}:${dateAdded.getMinutes()}`; - data.dateAdded = dateAdded; - let upperCase = ''; - for (let i = 0; i < data.username.length; i++){ - if (data.username.charAt(i) === data.username.charAt(i).toUpperCase()){ - upperCase += data.username.charAt(i); + dataString += data; + data = JSON.parse(dataString); + wasLastAnAdmin = data.admin; + let dateAdded = new Date(); + dateAdded = `${dateAdded.getFullYear()}-${dateAdded.getMonth()}-${dateAdded.getDate()} ${dateAdded.getHours()}:${dateAdded.getMinutes()}`; + data.dateAdded = dateAdded; + let upperCase = ''; + for (let i = 0; i < data.username.length; i++){ + if (data.username.charAt(i) === data.username.charAt(i).toUpperCase()){ + upperCase += data.username.charAt(i); + } + } + if (upperCase.length > 0){ + data.nick = upperCase; + } else{ + if (data.username.length === 0){ + data.nick = 'Blank'; + } else { + data.nick = data.username.charAt(0); + } } - } - if (upperCase.length > 0){ - data.nick = upperCase; - } else{ - if (data.username.length === 0){ - data.nick = 'Blank'; + response.end(data.nick); + if (appdata.length === 0){ + data.id = 0 } else { - data.nick = data.username.charAt(0); + data.id = parseInt(appdata[appdata.length - 1].id) + 1; } - } - if (appdata.length === 0){ - data.id = 0 - } else { - data.id = parseInt(appdata[appdata.length - 1].id) + 1; - } - appdata.push(data); - - }) + appdata.push(data); + }) response.writeHead( 200, "OK", {'Content-Type': 'text/plain' }); - response.end(); + } } From c5e3b1d4bdf30ef157115899e72ed24ed5a4a5d0 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Sat, 12 Sep 2020 12:57:59 -0700 Subject: [PATCH 12/14] readme --- README.md | 87 ++++--------------------------------------------------- 1 file changed, 6 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 38593962..2c40fd93 100755 --- a/README.md +++ b/README.md @@ -1,84 +1,9 @@ -Assignment 2 - Short Stack: Basic Two-tier Web Application using HTML/CSS/JS and Node.js -=== - -Due: September 16th, by 11:59 AM. - -This assignment aims to introduce you to the concepts and practice involved in creating a prototype (i.e. not deployment ready) two-tiered web application. - -The baseline aims of this assignment involve creating an application that demonstrates the use of several specific pieces of HTML, CSS, JavaScript, and Node.js functionality. - -Baseline Requirements ---- - -Note that there is a very large range of application areas and possibilities that meet these baseline requirements. Make your application do something useful! A todo list, storing / retrieving high scores for a very simple game, have a little fun with it. - -Your application is required to implement the following functionalities: - -- a `Server` which not only serves files, but also maintains a tabular dataset with 3 or more fields related to your application -- a `Results` functionality which shows the entire dataset residing in the server's memory -- a `Form/Entry` functionality which allows a user to add, modify, or delete data items residing in the server's memory -- a `Server Logic` which, upon receiving new or modified "incoming" data, includes and uses a function that adds at least one additional derived field to this incoming data before integrating it with the existing dataset -- the `Derived field` for a new row of data must be computed based on fields already existing in the row. For example, a `todo` dataset with `task`, `priority`, and `creation_date` may generate a new field `deadline` by looking at `creation_date` and `priority` - -Your application is required to demonstrate the use of the following concepts: - -HTML: -- One or more [HTML Forms](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms), with any combination of form tags appropriate for the user input portion of the application -- A results page displaying all data currently available on the server. You will most likely use a `
` tag for this, but `
    ` could also work and might be simpler to work with. - -CSS: -- CSS styling of the primary visual elements in the application -- Various CSS Selector functionality must be demonstrated: - - Element selectors - - ID selectors - - Class selectors -- CSS positioning and styling of the primary visual elements in the application: - - Use of either a CSS grid or flexbox for layout - - Rules defining fonts for all text used; no default fonts! Be sure to use a web safe font or a font from a web service like [Google Fonts](http://fonts.google.com/) - -- CSS defined in a maintainable, readable form, in external stylesheets - -JavaScript: -- At minimum, a small amount of front-end JavaScript to get / fetch data from the server; a sample is provided in this repository. - -Node.js: -- An HTTP Server that delivers all necessary files and data for the application. A starting point is provided in this repository. - -Deliverables ---- - -Do the following to complete this assignment: - -1. Fork the starting project code. This repo contains some starter code that may be used or discarded as needed. -2. Implement your project with the above requirements. -3. Test your project to make sure that when someone goes to your main page, it displays correctly. -4. Deploy your project to Glitch, and fill in the appropriate fields in your package.json file. -5. Ensure that your project has the proper naming scheme `a2-yourname` so we can find it. -6. Modify the Readme to the specifications below. -7. Create and submit a Pull Request to the original repo. Label the pull request as follows: a2-gitusername-firstname-lastname - -Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions) ---- - -## Your Web Application Title -Include a very brief summary of your project here. -Images are encouraged, along with concise, high-level text. - -Here is a sample formula for summarizing your activities, talk about: -- the domain area the project pertains to -- the main challenges or problems the application addresses -- the key innovations that make it possible to address the problem -- the main results of the implementation, does it really address the problem? -- any additional implications of the resulting application, or possibly areas for future work that have been discovered as part of the design and implementation activities - -(Note that when I use the above formula, I aim to have only one sentence per thought in order to remain concise.) - +## User Management +Made a small way to keep track of users and their data, along with admin privledges and remembering users +By using localstorage I can keep track of users throughout user sessions +While this tries to solve the problem of keeping track of users, it is very bare bones in terms of features, and because of the lack of any server, if the server goes down for any reason all user data is lost. +I hope that in the future I can add a sql server to this in order to keep track of users better, as well as a better way to keep track of users, as currently a user could modify their localstorage in order to pretend to be someone else. http://a2-charlieroberts.glitch.me ## Technical Achievements -- **Tech Achievement 1**: Using a combination of... -- **Tech Achievement 2**: ... - -### Design/Evaluation Achievements -- **Design Achievement 1**: Shown in `style.css`, the code... -- **Design Achievement 2**: We tested the application with n=X users, finding that... +Using localstorage, I am able to keep track of user nicknames through different browser sessions, and keep individual sessions independant. From b51a3b163be66eab8a60d35dda74b02808b30d94 Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Sat, 12 Sep 2020 13:14:09 -0700 Subject: [PATCH 13/14] glitch link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c40fd93..5c6f1e00 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Made a small way to keep track of users and their data, along with admin privled By using localstorage I can keep track of users throughout user sessions While this tries to solve the problem of keeping track of users, it is very bare bones in terms of features, and because of the lack of any server, if the server goes down for any reason all user data is lost. I hope that in the future I can add a sql server to this in order to keep track of users better, as well as a better way to keep track of users, as currently a user could modify their localstorage in order to pretend to be someone else. -http://a2-charlieroberts.glitch.me +https://a2-edkazcarlson.glitch.me/ ## Technical Achievements Using localstorage, I am able to keep track of user nicknames through different browser sessions, and keep individual sessions independant. From 03cedac06252fbe30fe6403c4e1bc9dea862076f Mon Sep 17 00:00:00 2001 From: Edward Carlson Date: Tue, 15 Sep 2020 13:14:41 -0700 Subject: [PATCH 14/14] changed to validate --- public/index.html | 98 +++++++++++++++++++------------------- public/results.html | 112 ++++++++++++++++++++++---------------------- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/public/index.html b/public/index.html index 459fccec..344f34de 100755 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@

    User Entry

    - +
    @@ -22,56 +22,56 @@

    User Entry


    - +
    - - + + + diff --git a/public/results.html b/public/results.html index eab62133..61f0219f 100644 --- a/public/results.html +++ b/public/results.html @@ -25,64 +25,64 @@

    Users Table

Delete
- - + +