Skip to content

tabiul/flickersearch-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Simple Flicker Search App

The webApp allows the user to search for a specific photo available in Flicker(https://www.flickr.com/) via a keyword search

Technologies

why Go

  • cross-platform programming language that allows creation of REST API without the need of any additional framework
  • concurrency support is build into the language

why AngularJS

  • easy framework to build SPA web application. No need to learn new language to use like REACT
  • no need of additional tooling for compilation

Requirements

Setup

  • download Go (https://golang.org/dl/)
  • setup GOROOT environment variable (refers to the above link for further details for os specific instruction)
  • add $GOROOT/bin to PATH environment variables
  • clone this repo
  • setup GOPATH environment variable (refers to location where the project is cloned, let say you cloned the project in the directory c:\flickersearch-app then this will be the value of the variable)

Build

 python build.py

Test

 python build.py --test

Clean

 python build.py --clean

Running

Linux

navigate to folder bin/linux_amd64

./flickersearch -apiKey <apiKey> -port 8080 -webapp <path to webapp folder that is found in the root folder>

Windows

navigate to folder bin\windows_386

flickersearch.exe -apiKey <apiKey> -port 8080 -webapp <path to webapp folder that is found in the root folder>

The webapp assumes port 8080. Should you decide to change the port then you will need to update the js scripts accordingly

Features

WebApp

  • Create an account to perform search. A default account admin with password admin is available (it is hardcoded, not a good idea but good for quick testing as the users are stored in memory)
  • Enter the preferred search criteria and click on the search button. The last 10 searches are available as autocomplete
  • A listing of 5 thumbnail photo will be shown. Click on any thumbnail to view a larger photo
  • Click on << and >> to navigate to previous and next page
  • Click logout to logout

Server

Following REST API are available

image

search for images

/image?search=<search criteria>&page=<page number>&username=<username>
  • username is optional. provide this if you want to keep track of history of specific user searches
  • page is optional. provide this if you want specific page

history

retrieve user search history. system keep tracks of only last 10 searches

/history?username=<username>

if there are any history for the user then it will be returned else HTTP status No Content will be response

user

create new user

/user

POST keys

  • username
  • password

username and password is stored in a map for simplicity. In addition the password is stored in base64 encoding which is also terrible idea

improvements

  • store username and password in proper db
  • use bcrypt with salt for password storage

authentication

authenticate user

/authenticate

POST keys

  • username
  • password

TODO

  • add server side authentication using token
  • add db for persistence
  • improve the ui (terrible at the moment)

About

Simple App that allows the user to search for a specific photo available in Flicker(https://www.flickr.com/) via a keyword search

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published