Skip to content

Latest commit

 

History

History
168 lines (129 loc) · 3.52 KB

README.md

File metadata and controls

168 lines (129 loc) · 3.52 KB

Tinder App - Users Service

User service for Tinder App. Handles and stores all the user information

Roadmap

View the project roadmap here

Contributing

See CONTRIBUTING.md for contribution guidelines.

Table of Contents

  1. Usage
  2. API Usage
    1. Input
    2. Output
  3. Requirements
  4. Development
    1. Installing Dependencies
    2. Tasks

Usage

API Usage

Input

Query will happen with one of two unique keys

{
  type: STRING,
  query: NUMBER or STRING,
  gender: STRING,
  filter: ARRAY,
  startDate: STRING,
  endDate: STRING
}
  • type Can be either user or stat. Defaults to user.

  • query Used with type user. User ID num or zone string. Can accept an array

  • gender Used with type user. OPTIONAL. The gender of users to retrieve

  • filter Used with type user. OPTIONAL. An array of userIDs to omit from results, e.g. swiped users

  • startDate Used with stat. Start of period to query for stats. Takes formats supported by PostgreSQL. Defaults at first entry

  • endDate Used with stat. End of period to query for stats. Takes formats supported by PostgreSQL. Defaults at last entry

Example User Request Parameters

Get full information on user with ID #7443

{
  type: 'user',
  query: 7443
}

Get all females from "Zone A" except userIDs 56 and 69

{
  type: 'user',
  query: 'A',
  gender: 'F',
  filter: [65, 69]
}
Example Stat Request Parameters

Get stats from Oct 31 1984 to Dec 25 1984

{
  type: 'stat',
  startDate: '1984-10-31'
  endDate: '1984-12-25'
}

Output

Type 'user'
[{
  userId: NUMBER,
  name: STRING,
  email: STRING,
  gender: STRING,
  location: STRING,
  photoCount: NUMBER,
  traits: ARRAY
}]

The return object has been built to include information irrelevant to the MVP, for future expansion opportunity

  • userId The user's ID number
  • name The user's name
  • email The user's email count
  • gender The user's gender
  • location Which zone the user is located in
  • photoCount The number of photos the user has uploaded
  • traits An array of objective terms that can be used to describe the user's physical appearance. Represents a photo of user
Type 'stat'
{
  errorsCounted: NUMBER,
  entries: NUMBER,
  averageEntryTime: NUMBER,
  averageRetrieveTime: NUMBER
}
  • errorsCounted The number of insertion/read errors generated in the database
  • entries Number of entries in the database
  • averageEntryTime Average time it takes to insert in milliseconds
  • averageRetrieveTime Average time it takes to retrieve in milliseconds

Requirements

  • Node 6.9.x
  • Postgresql 9.6.x
  • express 4.16.2
  • faker 4.1.0
  • mocha 4.0.1
  • chai 4.1.2
  • pg 7.3.0
  • pg-hstore 2.3.2
  • sequelize 5.15.0

Development

Installing Dependencies

Run npm install

Tasks

Simulation

  • Simulate new user sign-ups
  • Simulate account deletions
  • Simulate user information pulls

Monitoring/Testing

  • Time for insertion saved
  • Time for retrieve saved
  • Time for remove saved
  • Errors logged out into log directory

Other Information

Schema

Users

col type
name VARCHAR
traits VARCHAR
gender VARCHAR
photo_count INT
email VARCHAR
location VARCHAR