The webApp allows the user to search for a specific photo available in Flicker(https://www.flickr.com/) via a keyword search
- cross-platform programming language that allows creation of REST API without the need of any additional framework
- concurrency support is build into the language
- easy framework to build SPA web application. No need to learn new language to use like REACT
- no need of additional tooling for compilation
- Go 1.6 or later
- Golint (https://github.com/golang/lint). Make sure
golint
is added to PATH. This is optional - Python 2.7 (used for building)
- 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)
python build.py
python build.py --test
python build.py --clean
navigate to folder bin/linux_amd64
./flickersearch -apiKey <apiKey> -port 8080 -webapp <path to webapp folder that is found in the root folder>
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
- 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
Following REST API are available
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
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
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
- store username and password in proper db
- use bcrypt with salt for password storage
authenticate user
/authenticate
POST keys
- username
- password
- add server side authentication using token
- add db for persistence
- improve the ui (terrible at the moment)