jwt-decode
What is this?date-fns
I remember you.react-scripts
What is this? It seems to be used in 'scripts' to streamline starting up a react project:
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
-
What are the public and private route utilities? It looks like a layer over a component that decides whether or not they are accessible via token in one, and the exact opposite for the other.
-
what is utils.js? Is this really breaking down each element functionally? This is insane.
-
An implementation of star rating I probably won't steal. Seems to read the rating and then fill the stars based on that when loading.
-
Thingcontext and thinglistcontext - seem to contain functions that help manipulate the things in different contexts statefully.
-5 routes corresponding to CRUD endpoints. NotFound covers 'everything else?'
process.env.TZ = 'UTC'
Why is this set this way?
-
What is treeize? "Converts tabular row data (as from SQL joins, flat JSON, etc) to deep object graphs based on simple column naming conventions - without the use of an ORM or models." Remaps flat data into tree structure - deep object graphs, API-ready data.
-
Used in
things-service.js
to 'treeize' the reviewdata. Declare a treeize-class variable, then use it to 'grow' input data (must be an array) into a tree structure. -
What is
const reviewData = reviewTree.grow([ review ]).getData()[0]
doing? Something with reorganizing the flat input from a review during serializeReview() in things-service.js so it's 'api ready' -
"private":true ?
- The data structure is declared in INSERT w/o a TYPE?
- Rating?
- This seems to truncate the table in order; acts as 'unseeder'. Why is this separate from migrations? Will we be able to call this in other places like a func? Good for cleaning db, maybe using different seeds.
script: psql -U thingful -d thingful -f ./seeds/thingful_tables.sql
thingful-things <-> thingful_users <<-> thingful_reviews
"What is PostgreSQL SERIAL PRIMARY KEY?" -speedier syntax for incrementing key, good for primary id.
- Uses raw data to select instead of knex methods.
-
What is async and await? How do they work?
An async function 'always' explicitly returns a promise; an await, which 'must' be in an async function. It 'awaits' the result of a promise before executing. This would be good for asynchronous content, such as wait screens, and handling feedback for calls where you are uncertain of the outcome.
It is essentially a cleaner syntax for a promise chain, less of an eyesore than a then chain.
So Async checkThingExists() - the function is out of sequence; it listens for 'thing', a constant that awaits the thing being checked for in the db, and produces feedback when it is discovered.
-
What is Restart Identity Cascade?
-
RESTART IDENTITY
Automatically restart sequences owned by columns of the truncated table(s).
-
CASCADE
Automatically truncate all tables that have foreign-key references to any of the named tables, or to any tables added to the group due to CASCADE.