Use: Provides JWT auth for registering users, secure login, and protected endpoints. Provides database for user profile information and wine entry history.
Creates user profile storing all profile info in Express database with hash encrypted password.
newUser: {
username: text required,
password: text required
}
newUser: {
user_id: generated integer,
username: string,
password: string
}
Provides bcrypted secure login with JWT auth token protection.
{
username: text required,
password: text required
}
authToken: string
Object: {
user_id: integer,
username: string,
password: string
}
Retrieves a collection of response objects of the user's wine entries since their profile was created. Requires authentication.
{
user_id: integer required,
}
Object(s): [{
user_id: integer,
wine_id: integer,
winemaker: string,
wine_type: string,
wine_name: string,
varietal: string,
vintage: integer,
region: string,
tasting_notes: string,
rating: integer,
img_url: string,
}]
Saves wine entries to the logged in user's profile. Requires authentication.
Object(s): {
user_id: integer required,
winemaker: text required,
wine_type: text required,
wine_name: text,
varietal: text,
vintage: integer,
region: text,
tasting_notes: text,
rating: integer,
img_url: text,
}
Object(s): {
user_id: integer,
wine_id: integer,
winemaker: string,
wine_type: string,
wine_name: string,
varietal: string,
vintage: integer,
region: string,
tasting_notes: string,
rating: integer,
img_url: string,
}
Express
Node
Knex
Postgrator
Mocha, Chai, Supertest
JSON Web Token, bcryptjs