Giter Site home page Giter Site logo

ts-foursquare's Introduction

Hi there 👋

  • 🔭 I’m currently working on React, Typescript, GraphQL, Node.js, MongoDB, gRPC, Websocket, K8s
  • 🌱 I’m currently learning React Native, Expo, NestJS, Prisma, Postgresql, GraphQL, Solidity
  • 👯 I’m looking to collaborate on fun project

📊 Github stats

💻 GitHub Profile Stats

Github Stats Most Used Languages

🎆 GitHub Streak

Streak Stats

ts-foursquare's People

Contributors

arnaud-zg avatar dependabot[bot] avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bitq2019

ts-foursquare's Issues

chore(test): add unit test for reducers [2]

chore(test): add unit test for reducers

Goal: Increase global code coverage

Tasks:

  • Import reducer
  • Make a snapshot of updated state

Extra materials:

N/A

Types

N/A

Useful links

N/A

Related issues

N/A

feat(store): add redux store creator with epics [3]

feat(store): add redux store creator with epics [3]

Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"

Tasks:

  • Create a function named configureStore()
    • Combine all available reducers into store
    • Inject middlware with all epics

Extra materials:

We should have access to configureStore, example: import { configureStore } from 'ts-foursquare'

Types

N/A

Useful links

https://redux.js.org/api/createstore
https://redux.js.org/api/combinereducers
https://redux-observable.js.org/docs/basics/SettingUpTheMiddleware.html

Related issues

N/A

feat(playground): add search venues search in demo mode [2]

feat(playground): add search venues search in demo mode

Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"

Tasks:

  • Create a story
  • Create a container VenuesSearchContainer
  • Create a component VenuesSearch, which is connected to VenuesSearchContainer
  • Use mapDispatchToProps and add requestGetVenuesSearch
  • Render venues.entities in VenuesSearch

Extra materials:

N/A

Types

N/A

Useful links

N/A

Related issues

N/A

feat(venue-explore): create an epic venue explore [1]

feat(venue-explore): create an epic venue explore

N/A

Tasks:

  • Udapte EApiPathnames, add endpoint for venue explore
  • Create an epic getVenuesExploreEpic
  • Use adaptGetVenuesSearch on service callback
  • On error case, dispatch EVenuesAction.GET_VENUE_EXPLORE_FAILURE
  • On multiple call, dispatch EVenuesAction.GET_VENUE_EXPLORE_CANCEL

Extra materials:

N/A

Types

N/A

Useful links

Related issues

#156
#159
#158

feat(playground): add credentials in demo mode [2]

feat(playground): add credentials in demo mode

Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"

Tasks:

  • Create a story
  • Create a container LifeContainer
  • Create a component Life, which is connected to LifeContainer
  • Dispatch putCredentials when user click on button
  • Render life.status in LifeContainer

Extra materials:

status color
false red
true green

Types

N/A

Useful links

N/A

Related issues

N/A

fix(reducer): detect return type of each reducer [2]

fix(reducer): detect return type of each reducer [3]

We should always specify return type when we create a reducer, example just below.

    [ELifeAction.RESOLVE_GET_LIFE]: (state, action): NLife.IState => ({
      ...state,
      ...action.payload,
    }),

Tasks:

  • Check on each reducer if return type is specified
  • Update unit test
  • Create action with createAsyncAction
  • Handle this action on epic middleware
  • If it's success dispatch an action.success
  • If there is an error dispatch an action.failure
  • On the reducer, handle three cases: success, failure, cancel (optional)

Extra materials:

N/A

Types

N/A

Useful links

Related issues

N/A

feat(venue-location): add venue location selector [1]

Feature: Add venue location selector

Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff should see venue's location

Tasks:

  • Create a selector getVenueLocation

Extra materials:

We should do a search like that: getVenueLocation(venueList)

Types

export const getVenueLocation = (venueList: IVenue[]): ILocation  => {}

Useful links

N/A

Related issues

feat(venue-trending): create a service for venue trending [2]

feat(venue-trending): create a service for venue trending

Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.

Tasks:

  • Call endpoint with fromFetch
  • Get location href with getLocationHref
  • Handle success and error cases with: processFetchResponse and processFetchError

Extra materials:

N/A

Types

N/A

Useful links

Related issues

#189

feat(search): find a venue with latitude and longitude parameters [3]

Feature: Find a venue with latitude and longitude parameters

Scenario: As a user, I want to do a search for a venue
Given Jeff gave my location information (latitude & longitude)
Then Jeff should see a list of venues

Tasks:

  • The endpoint ENDPOINT: venues/search can now accept parameter PARAMETERS: lat/long = 40.7337621,-74.0095604; intent = checkin
  • By default if lat/long are provided automatically set intent = checkin
  • Create an interface for requestGetVenuesSearch's payload

Extra materials:

We should do a search like that: requestGetVenuesSearch({ ll: '40.7099,-73.9622' })

Types

type TPayload = IGetVenuesSearchByWord | IGetVenuesSearchByLocation

export const requestGetVenuesSearch = (payload = TPayload) =>
  action(EVenuesAction.REQUEST_GET_VENUES_SEARCH, payload)

Useful links

https://developer.foursquare.com/docs/api/venues/search

Related issues

N/A

fix(selector): get life state on method lifeSelector [0,5]

Describe the bug
lifeSelector does not work properly

To Reproduce
Use lifeSelector with a valid state

Expected behavior
It should return whole life state, actually we only have the value of state.life.status, it should be state.life. Furthermore it may be interesting to add another selector for state.life.status (lifeStatusSelector ?).

Additional context

feat(venues): handle error case on venues epic [2]

feat(venues): handle error case on venues epic [2]

If there is no internet connection, every epic should handle error case.

Example:

      from(new Promise(...)).pipe(
        map(myAction.success),
        catchError(pipe(myAction.failure, of)),
        takeUntil(action$.pipe(filter(isActionOf(myAction.cancel)))),
      )

Tasks:

  • Use created async action
  • Handle error case
  • Handle cancel case
  • Store the status of the last request in store

Extra materials:

N/A

Types

N/A

Useful links

Related issues

#120

feat(venue-categories): add venue categories selector [1]

Feature: Add venue categories selector

Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff should see venue's categories

Tasks:

  • Create a selector getVenueCategories

Extra materials:

We should do a search like that: getVenueCategories(venueList)

Types

export const getVenueCategories = (venueList: IVenue[]): ILocation  => {}

Useful links

N/A

Related issues

feat(search): find a specific place nearby [2]

Feature: Find a specific place nearby

Scenario: As a user, Jeff want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues nearby

Tasks:

  • The endpoint ENDPOINT: venues/search can now accept parameter PARAMETERS: lat/long = 40.7629212,-73.9935085; query = ShopMart; intent = browse; radius = 500
  • Add a new type in TPayload, IGetVenuesSearchByWordNearby ?
  • Set a radius by default at 500

Extra materials:

We should do a search like that: requestGetVenuesSearch({ ll: '40.7099,-73.9622', query: "Something", intent: "browse", radius: 500 })

Types

type TPayload = IGetVenuesSearchByWord | IGetVenuesSearchByLocation | IGetVenuesSearchByWordNearby

export const requestGetVenuesSearch = (payload = TPayload) =>
  action(EVenuesAction.REQUEST_GET_VENUES_SEARCH, payload)

Useful links

https://developer.foursquare.com/docs/api/venues/search

Related issues

N/A

feat(venue-explore): add an action for get venue explore [1]

feat(venue-explore): add an action for get venue explore

Get a list of venues in exploration mode

Tasks:

  • Create an async action getVenuesExploreAsync
    • Create a new interface inside NRequest, IVenuesExplorePayloadByPlace, IVenuesExplorePayloadByLocation
    • Create a new interface IVenuesExplorePayload based on query parameters just below
    • Extends the two last interface with IVenuesExplorePayload
  • Update snapshot of EVenuesAction
  • Create a type for getVenuesExploreAsync.success, NRecommendedPlaces
    • Use NVenue.IVenue

Extra materials:

Query parameters:

ll
near
llAcc
alt
altAcc
radius
section
query
limit
offset
novelty
friendVisits
time
day
lastVenue
openNow
sortByDistance
price
saved

Types

Response

Example of response for GET https://api.foursquare.com/v2/venues/explore:

{
  "meta": {
    "code": 200,
    "requestId": "5ac51ef86a607143de8eg5cb"
  },
  "response": {
    "warning": {
      "text": "There aren't a lot of results near you. Try something more general, reset your filters, or expand the search area."
    },
    "suggestedRadius": 600,
    "headerLocation": "Lower East Side",
    "headerFullLocation": "Lower East Side, New York",
    "headerLocationGranularity": "neighborhood",
    "totalResults": 230,
    "suggestedBounds": {
      "ne": {
        "lat": 40.724216906965616,
        "lng": -73.9896507407283
      },
      "sw": {
        "lat": 40.72151724718017,
        "lng": -73.98693222860872
      }
    },
    "groups": [
      {
        "type": "Recommended Places",
        "name": "recommended",
        "items": [
          {
            "reasons": {
              "count": 0,
              "items": [
                {
                  "summary": "This spot is popular",
                  "type": "general",
                  "reasonName": "globalInteractionReason"
                }
              ]
            },
            "venue": {
              "id": "49b6e8d2f964a52016531fe3",
              "name": "Russ & Daughters",
              "location": {
                "address": "179 E Houston St",
                "crossStreet": "btwn Allen & Orchard St",
                "lat": 40.72286707707289,
                "lng": -73.98829148466851,
                "labeledLatLngs": [
                  {
                    "label": "display",
                    "lat": 40.72286707707289,
                    "lng": -73.98829148466851
                  }
                ],
                "distance": 130,
                "postalCode": "10002",
                "cc": "US",
                "city": "New York",
                "state": "NY",
                "country": "United States",
                "formattedAddress": [
                  "179 E Houston St (btwn Allen & Orchard St)",
                  "New York, NY 10002",
                  "United States"
                ]
              },
              "categories": [
                {
                  "id": "4bf58dd8d48988d1f5941735",
                  "name": "Gourmet Shop",
                  "pluralName": "Gourmet Shops",
                  "shortName": "Gourmet",
                  "icon": {
                    "prefix": "https://ss3.4sqi.net/img/categories_v2/shops/food_gourmet_",
                    "suffix": ".png"
                  },
                  "primary": true
                }
              ],
              "venuePage": {
                "id": "77298563"
              }
            }
          }
        ]
      }
    ]
  }
}

Useful links

Related issues

N/A

chore(test): add unit test for services [2]

chore(test): add unit test for services

Goal: Increase global code coverage

Tasks:

  • Import services
  • Add on mock on window.fetch

Extra materials:

N/A

Types

N/A

Useful links

N/A

Related issues

N/A

feat(search): add search for venues action [3]

Feature: Search for Venues

Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues

Tasks:

  • Store api keys with localStorage for client app
  • Store api keys with node-localStorage for server app
  • Create a util for Get / Set credentials
  • We can set credentials like that client.set(config)

Extra materials:

We should do a search like that: getVenuesSearch(payload)

Types

export const CLIENT_ID_KEY = 'apiClientId'
export const CLIENT_SECRET_KEY = 'apiClientSecret'

export interface ICredentials {
  [CLIENT_ID_KEY]: string
  [CLIENT_SECRET_KEY]: string
}

Useful links

Related issues

N/A

feat(venues-trending): add an action for get venues trending [1]

feat(venues-trending): add an action for get venues trending

Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.

Tasks:

  • Create an async action getVenuesTrendingAsync
    • Create a new interface inside NRequest, TVenuesTrendingPayload
  • Update snapshot of EVenuesAction
  • Return nothing on getVenuesTrendingAsync.success
    • Use NVenue.IVenue

Extra materials:

N/A

Types

<NRequest.TVenuesExplorePayload, NVenue.IVenue[], Error, string>()

Useful links

Related issues

N/A

feat(icon): add helper for icon [2]

Feature: Add helper for icon

Scenario: As a user, Jeff want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff sees the icons of the associated categories

Tasks:

  • Create a helper for icon
  • Create an enum for all supported icon size (32, 44, 64, and 88)
  • Generate an url for each icon size
  • For each size, generate and url with gray background and without
  • Return an object with size as key and url as value (hashmap)

Extra materials:

Icon

Pieces needed to construct category icons at various sizes.
Combine prefix with a size (32, 44, 64, and 88 are available) and suffix,
e.g. https://foursquare.com/img/categories/food/default_64.png.
To get an image with a gray background, use bg_ before the size,
e.g. https://foursquare.com/img/categories_v2/food/icecream_bg_32.png.

Types

enum EIconSize {}

interface IIcon {
  prefix: string
  suffix: string
}

interface IIconUrls {
  [EIconSize: string] : string
}

export const getIconUrlList = (icon: IIcon) : IIconUrls => {}

Useful links

Related issues

fix(url): handle url search parameter with undefined value [0,5]

Describe the bug
This function getLocationSearch generate a string, it should handle undefined value and avoid them.

To Reproduce
N/A

Expected behavior
Add this unit test:

    expect(getLocationSearch({ param: { name: undefined } })).toEqual(undefined)

Screenshots
N/A

Additional context
N/A

feat(venue-trending): create an epic venue trending [1]

feat(venue-trending): create an epic venue select

Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.

Tasks:

  • Udapte EApiPathnames, add endpoint for venue explore
  • Create an epic getVenuesTrendingEpic
  • On success case, dispatch EVenuesAction.GET_VENUES_TRENDING_SUCCESS
  • On error case, dispatch EVenuesAction.GET_VENUES_TRENDING_FAILURE
  • On multiple call, dispatch EVenuesAction.GET_VENUES_TRENDING_CANCEL

Extra materials:

N/A

Types

N/A

Useful links

Related issues

#189
#191

chore(test): add unit test for utils [1]

chore(test): add unit test for utils

Goal: Increase global code coverage

Tasks:

  • Add snapshot of EIconSize
  • Add uni test on testEpic

Extra materials:

N/A

Types

N/A

Useful links

N/A

Related issues

N/A

feat(async): handle async action on status module [1]

Describe the bug
About async action, we should have a module for every action; for example on venuesActionsAsync we should have only one object for 4 actions (request, failure, cancel, success).

To Reproduce
Steps to reproduce the behavior:

  1. Go to '2-Module/Venues/Action/getVenuesSearchAsync'
    2.1. Write some content into query, for example 'fresh salad'
    2.2. Click on 'Send'
  2. See error in the result block

Expected behavior

{ "getVenuesSearchAsync": { "hasError": false, "isLoading": false } }

Screenshots
image

Additional context
N/A

feat(status): add status module [2]

Add status module

The idea is to store every action status.

Tasks:

  • Define a new type for status NStatus
  • Create a store statusReducer
  • Handle every async action
  • Update isLoading if needed
  • Update hasError if neeede
  • Create selector

Extra materials:

N/A

Types

N/A

Useful links

N/A

Related issues

N/A

feat(playground): support asynchronous actions success [2]

feat(playground): support asynchronous actions success [2]

support asynchronous actions success

Tasks:

  • On playground
  • User can click on Success button
    • Create a mock for response
    • Dispatch asyncAction.success, with created mock as parameter
  • Create a component FormAsyncActions

Extra materials:

N/A

Types

FormAsyncActions

interface IProps {
  asyncAction: getVenuesSearchAsync | getVenuesExploreAsync
}

Useful links

Related issues

N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.