Skip to content

Server side app for full stack capstone project, Uncorked

Notifications You must be signed in to change notification settings

schism578/uncorked-api

Repository files navigation

app icon

Uncorked API

Use: Provides JWT auth for registering users, secure login, and protected endpoints. Provides database for user profile information and wine entry history.

API Documentation:

Create User Endpoint

POST /user

   Creates user profile storing all profile info in Express database with hash encrypted password.

Sample Request:

   newUser: {
        username: text required,
        password: text required }

Sample Response:

   newUser: {
        user_id: generated integer,
        username: string,
        password: string }

Login Endpoint

POST /auth/login

   Provides bcrypted secure login with JWT auth token protection.

Sample Request:

   {
      username: text required,
      password: text required
   }

Sample Response:

        authToken: string
   Object: {
        user_id: integer,
        username: string,
        password: string
   }

Wine Endpoints

GET /wine/:user_id

   Retrieves a collection of response objects of the user's wine entries since their profile was created. Requires authentication.

Sample Request:

   {
      user_id: integer required,
   }

Sample Response:

   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,
   }]

POST /wine/:user_id

   Saves wine entries to the logged in user's profile. Requires authentication.

Sample Request:

   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,
   }

Sample Response:

   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,
   }

Technologies:

   Express
   Node
   Knex
   Postgrator
   Mocha, Chai, Supertest
   JSON Web Token, bcryptjs

About

Server side app for full stack capstone project, Uncorked

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published