Skip to content

An app to geographically visualize and organize tattoo artist information.

Notifications You must be signed in to change notification settings

kenziebottoms/artograph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artograph

An app to geographically visualize and organize tattoo artist information.

car·to·graph

/ˈkɑr tə ˌgræf/, noun

an illustrated map

Run Locally

git clone git@github.com:kenziebottoms/artograph.git
cd artograph
npm install

Copy server/db/config/config.sample.json to ../config.json and updated the credentials for your local environment.

npm run db:reset
npm start:dev

Database ops

  • npm run db:regen: generate database from server/db/seeders
  • npm run db:save: save current database to server/db/export.sql
  • npm run db:reset: reset database to last saved


Goals

  • Users can search a list of artists by
    • name,
    • tags,
    • region name.
  • User can select their current location and receive a filterable list of tattoo artists ordered by distance from that point.
  • User can enter in tattoo artist information for other users to browse.
  • Users can add tags to artists that other users can search by.
  • Users can mark artists as their favorites.
  • User can filter and search on their favorites.

Stretch Goals

  • App will automatically geolocate user.
  • App will scrape instagram to show recent tattoos.
  • App will reverse-geocode latitude and longitude and infer a region name.
  • Users can edit artist information and tags.
  • Users can up- and downvote others’ tags.
  • Users can look up an Instagram account and the app will try and guess/scrape the artist’s information and location.

Tech

Links


API Endpoints (all preceded by /api/v1)

Instagram scraping

GET /insta/:username

Returns metadata on the given user scraped from Instagram, and a 4-post feed with image and post links.

Authentication

Path Method Result
/register POST Register
/login POST Login
/logout POST Logout

Artists

GET /artists

Returns a list of all artists.

Query string Effect
[none] Sorts artists by id.
sort=alpha Sorts artists alphabetically by last name.
lat=:lat&lng=:lng Sorts artists by distance from [lat, lng].

Note: lat and lng will be ignored if they are not valid numbers.

POST /artists

Checks for an existing artist with the given email; if not found, validates data, and adds new artist. Returns 409: Conflict if there is a duplicate and 400: Bad Request if the data doesn't validate (for example, if lng/lat aren't numbers).

GET /artists/:id

Returns one artist by id.

PATCH /artists/:id

Updates the artist with the given id without overwriting unaddressed properties.

GET /artists/tagged/:tag

Returns a list of all artists associated with the given tag.

Query string Effect
[none] Sorts artists by id.
sort=alpha Sorts artists alphabetically by last name.
lat=:lat&lng=:lng Sorts artists by distance from [lat, lng].

GET /artists/nearby?lat=:lat&lng=:lng&allowance=:allowance

Returns a list of artists within an allowance by allowance latitude/longitude point square of the given [lat, lng]. lat, lng, and allowance are all required and this endpoint will return 400: Bad Request if they are invalid or not supplied.

Tags

GET /tags

Returns a list of all tags.

POST /tags

Checks for an existing tag with the given name; if not found, validates data, and adds new tag. Returns 409: Conflict if there is a duplicate and 400: Bad Request if the data doesn't validate (for example, if there's no name property in the request body).

GET /tags/:id

Returns one tag by id.

GET /artists/:id/tags

Returns a list of the tags associated with the provided artist.

GET /tags/like/:q

Returns a list of tags whose titles contain q (case-insensitive).

GET /tags/matching/:q

Returns a list of tags whose titles match q (case-insensitive).

Users

GET /user

Returns the currently authenticated user. Returns { user: null } if there isn't one.

Favorites

GET /user/:id/faves

Returns the ids of the given user's favorite artists.

Query string Effect
verbose=true Returns the full artist object for each favorite.

GET /user/faves

Returns the ids of the currently authenticated user's favorite artists. Returns 401: Unauthorized if no one's logged in.

Query string Effect
verbose=true Returns the full artist object for each favorite.

POST /user/faves/:artistId

Adds the artistId as a favorite to the currently authenticated user. Returns 401: Unauthorized if no one's logged in.

DELETE /user/faves/:artistId

Removes the artistId from the currently authenticated user's favorites. Returns 401: Unauthorized if no one's logged in.


Angular Routes

Path Description
/#!/ Homepage
/#!/new Add new artist form
/#!/faves Authenticated user's faves
/#!/tags/:tag Artists listed with the given tag
/#!/edit/:id Edit artist form
/#!/login Login form
/#!/register Registration form