These are my sketches and entity relationship diagram for the Noteful database.
const knex = require('knex') | |
require('dotenv').config() | |
const knexInstance = knex({ | |
client: 'pg', | |
connection: process.env.DB_URL | |
}) | |
function searchByName(searchTerm) { | |
knexInstance |
const ShoppingListService = { | |
getAllItems(knex){ | |
return knex.select('*').from('shopping_list') | |
}, | |
insertItem(knex, newItem) { | |
return knex | |
.insert(newItem) | |
.into('shopping_list') | |
.returning('*') | |
.then(rows => { |
-- 1. How many people work in the Sales department? | |
SELECT | |
COUNT(e.id) | |
FROM | |
employee e | |
JOIN | |
department d | |
ON | |
e.department = d.id | |
WHERE |
How are the syntaxes async and await useful when writing JavaScript code?
The word “async” before a function means the function always returns a promise and wraps non-promises in it. The keyword await makes JavaScript wait until that promise settles and returns its result. Async Await makes execution sequential.
With respect to Knex, how does the transaction method relate to BEGIN and COMMIT syntax in PostgreSQL?
In PostgreSQL, BEGIN initiates a transaction block. All statements after a BEGIN command will be executed in a single transaction until an explicit COMMIT or ROLLBACK is given.
Should the client or the server take more security precautions? Server.
What's the difference between local storage and session storage? Session storage is the same as local storage except that the data doesn't persist outside of the tab (session). The difference between local and session storage is that while local storage is always available in any tab and window of the same machine's browser, session storage isn't. Session storage is only available in the browser tab that the data was saved in, as soon as that tab is closed, the data is gone. As a result, session storage gives us an extra security feature for the frontend.
What problem does a JWT expiry time solve? JWT expiry time restricts the amount of time that an authorization token is valid for. This gives the server more control of the validity of any JWTs it creates instead of relying on the frontend client to ensure tokens aren't stolen.
Is a refresh endpoint protected or public?
Tracking the most important things that I need to get done during the week should be as easy as possible so that I can spend more time doing those things. The MuchToDo App will be a simple to do list tracker app.
Role | Task | Importance |
---|---|---|
As a new user | I want to sign up for an account | High |
As a returning user | I want to add a new to do list item | High |
As a returning user | I want to delete an existing to do list item | High |
As a returning user | I want to update an existing to do list item | High |
As a returning user | I want to check off a completed to do list item | High |
As a returning user | I want to create categories for my to do list items | Medium |
As a returning user | I want to assign a category to my to do list item | Medium |
As a returning user | I want to assign a due date for my to do list item | Medium |
- Live Static Version for MuchToDo Client: https://muchtodo-client.ccarlson.now.sh/
- GitHub Repo for MuchToDo Client: https://github.com/chriscarlsondev/muchtodo-client
User | Feedback | Action Taken |
---|---|---|
Erica | - Added a category and expected the category to show up on the main page of the app after added instead of as an option when adding a new Category - Wondered why the tasks didn't stay when she navigated away from the page |
- No action taken - Explained that this was just the frontend version of the code and that I needed backend functionality in place in order to save changes over time |
Melissa | - Thought that the app overall worked well but the general look of the app needed to be improved in order for her to be interested in using it. | - No action taken since UI enhancement will happen later as part of the project |