Giter Club home page Giter Club logo

puttyimages-web's Introduction

puttyimages CircleCI codecov Greenkeeper badge

Puttyimegs is an open stock image DApp that live within the LikeCoin ecosystem.

Development Setup

The suggested way of development environment is docker based. This guide will assume you have Docker Community Edition 18+ installed. Please download at https://store.docker.com and follow the installation instruction.

After you setup docker, fun the following command to setup the docker image and basic DB schema. Also kick start the docker container for development.

# Build the docker images, run it for the first time or you have dependency
# updates
docker-compose build

# Run the DB migration and reseed the DB for the first time run or after you
# pull an update.
docker-compose run --rm nuxt npm run sequelize db:migrate
docker-compose run --rm nuxt npm run sequelize db:seed:all

# Kick of the development setup
docker-compose up

Local files are mount into docker you can modify file in your fs and will hot reload.

Env Setup

# For development
export LIKECHAIN_HOST=http://x.x.x.x
export PROVIDER_ADDRESS=0x
export PROVIDER_PRIVATE_KEY=xxx
docker-compose up

# For deployment
kubectl delete secret app-secret # remove old secret
kubectl create secret generic app-secret \
  --from-literal=LIKECHAIN_HOST=http://x.x.x.x \
  --from-literal=PROVIDER_ADDRESS=0x \
  --from-literal=PROVIDER_PRIVATE_KEY=xxx

Test

make test

Continuous Integration

Oursky hosts a staging continuous integration pipeline for fast review. The deployed endpoint is https://puttyimages.pandawork.com. The endpoint is in sync with the master branch of Oursky fork via Travis-CI. You can send PR to the branch if you want your changes reflect on the review endpoint.

The continuous integration setup is assuming an kubernetes environment. If you want to deploy your own instances, you can checkout the ./k8s folder for details.

Production

docker-compose -f docker-compose.yml -f docker-compose.production.yml --project-name puttyimages_prod build
docker-compose -f docker-compose.yml -f docker-compose.production.yml --project-name puttyimages_prod up

For detailed explanation on how things work, checkout the Nuxt.js docs.

Backpack

We use backpack to watch and build the application, so you can use the latest ES6 features (module syntax, async/await, etc.).

puttyimages-web's People

Contributors

aludirk avatar greenkeeper[bot] avatar indream avatar mckingho avatar mileswong avatar nwingt avatar rickmak avatar williamchong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

puttyimages-web's Issues

Vuex store is missing

not sure if we need it now but it would be useful anyway in the future?
Or do we have other plans for state management

List reported image in admin site

Need #9
Needed by #9

  • Can unpin image from CMS
  • If image is unpinned, send an email notifying the user about the action
  • Admin need to choose a reason for taking down a reported image
  • See list of reported images in CMS, ranked from earliest to newest (can invert)
  • Can reject reported image (mark as safe), resolves the report and the image will continued to be pinned in the index

Created from Aha! https://oursky.aha.io/features/PUT-19

CI setup

Needed: #5
Needed by: The humans that needed saving.

Refs: #5

  • Travis setup - test, deployment
  • Trigger reload upon new public docker image is uploaded

Add new image page

Error message:

https://docs.google.com/spreadsheets/d/1NAbJdl7Pti4D\_lhzBd1A\_C9pC25L4nlouZVdI28hvOU/edit#gid=0

  • Can be accessed when user goes to a certain URL

  • Checks if metamask wallat app is available and is linked to a recognized likecoin user

  • When file is uploaded, shows a preview of the image

  • User can use a file picker the upload file

  • When user selected the file, validate the image and check if it matches the requirement of puttyimage assets
    Size, file format etc...

  • Reject files that doesn't match the requirements and shows an error message

  • Shows form for entering information for the image

    • Image description (optional)

    • tags (must enter at least 1)

    • Image license (must select)

      • CC0
  • Shows disclaimer and terms to link

  • require users to explicitly click the "I accept the terms and conditions of puttyimage" checkbox before the image can be uploaded

  • Disable the button if user haven't checked the accept terms checkbox

  • When user clicks the Upload image now button, validates the input in the form, shows error message next to field where necessary

  • Checks for similar image and warn user they should only upload original image

  • Check if identical images had been uploaded before and warn user that they should only upload original images they owned

  • only support png & jpg

  • no minimal size, max size allowed = 10Mb

  • require user to choose a license for the image being uploaded, can be one of 4
    cc0,

    cc-by,

    cc-by-sa,

    cc-by-nd

  • shows a hint under the license input: "Learn more about %license name", link to corresponding page of explaining the license
    cc0

    cc-by,

    cc-by-sa,

    cc-by-nd

  • user must input at least one tag

  • tag must be 2 - 20 characters

  • up to 5 tags can be added

  • must select a license to upload

  • if all checks pass, call API, upload image to IPFS and register the record on blockchain

  • generate and register embed code once upload is completed

  • When image upload failed, display an error message

Screen Shot 2018-06-28 at 18.03.07.png (https://oursky.aha.io/attachments/6572074087508617256/token/a68f6ef639d9b79785ad998c922fab537db2cd808c830c1ca45376c535a17d1e.download?size=original)

Created from Aha! https://oursky.aha.io/features/PUT-15

WordPress plugin

  • Validates if Metamask is available

  • Call keyword search API

  • List paginated search results in masonry view
    refs #PUT-20

  • Shown as a modal, on a dark black backdrop

  • Fixed height, scrolling within the modal is enabled

  • define shortcode to be initialized as embedded puttyimage images when the wordpress post is rendered

  • If plugin is installed, enabled and with proper configuration, superlike widget will be added to the end of articles

  • Handle cases where users haven't installed metamask yet

  • Handle cases where users haven't add a like coin id to their metamask yet

  • Handle cases where users wallet's like coin id isn't the same with the like coin ID registered to the post yet.

  • User should be able to configure the default amount of like coin user will donate for an article on a per post basis.

  • Once the plugin is installed - it should be enabled for all posts, including previous posts

  • Admin can choose the plugin (super like widget) to be enabled for all

  • The superlike widget can be disabled / enabled respectively for each article from the wordpress editor

  • Admin can set if authors can set their like coin ID separately (if disabled, all posts will have a donation icon for the default user, e.g. blog owner)

  • Each user should be able to register their like coin ID respectively if allowed

  • Can upgrade plugin with standard wordpress plugin mechanism

  • [Phase 3] Readers should be able to like image (from putty image) separately

  • [Phase 3] Writers should be able to upload images to PuttyImage

  • [Phase 3] When an article is published, the article should be put on the likeChain.

  • [Phase 3] The plugin should also check for duplication of article content among other articles on the likeChain (using Hash)

Created from Aha! https://oursky.aha.io/features/PUT-16

Image(asset/:id) get image meta and URL

  • Modify the schema add w/h
  • Add seed data, including script, add ipfs client to seeder
  • change controller format, adding url of the image to display
  • add functional test case.

Search result front-end

  • Input box with API call
    • Enter to trigger
    • Idle for 300ms to trigger api call (with throttle)
  • Display the seatch result in #22

Add a DEVELOPMENT.md

The document is intended to help Opensource developer to kick-start their development easily. It should include:

  1. Overview on the system component
  2. Common operation command, for example:
    1. How to generate migration
    2. How to run subset of test
    3. How to add a new API end-point
  3. Coding guidelines
  4. Pull Request
  5. Continuous Integration

Image detail view modal

Need #1
Needed by #7
Needed by #21
Needed by #15
Needed by #22

  • Shows close button on the top left

  • Shows uploader information
    Profile image, name & likecoin ID

  • Like widget

  • Show metadata
    Description

    Image tags

    license applied

  • shows embed code sections

  • link to report image for right violation / abuse

  • if user is authenticated and = the image's uploader, shows remove image button and disclaimer

  • RWD optimizations

Screen Shot 2018-05-17 at 18.17.09.png (https://oursky.aha.io/attachments/6556491974951220681/token/61d47457ebf607cf3f58da350f49b53b22e9fd1a8d457269ccf81ba52cfbff58.download?size=original)
Screen Shot 2018-05-17 at 18.17.06.png (https://oursky.aha.io/attachments/6556491975988589270/token/57bad5a35dcefe20fd2469b08645213c76abd417316d7a76147a9749316cf366.download?size=original)

Created from Aha! https://oursky.aha.io/features/PUT-11

should `plugins/ipfs` be actually in `/plugins`?

it is neither a nuxt plugin used by both server or client, nor needed by client as a plugin for Vue.use
should server side only code be moved into /server ? not like client will need to call ipfs api directly in the future

Like widget UI (3.5 days)

Needed by #3
Needed by #19
Needed: Integrate plan with LikeChain

https://oursky.github.io/likecoin-widget-ui/index.html

  • Shows icon and like count by default

  • Linked to a certain work on likechain (by fingerprint?)

  • remembers if current metamask user had liked the linked content, if liked, show button in pressed state.

  • when clicked, shows a pop over with list of option
    super like (pay likecoin from account)

    1 - 5 stars for "weight" of like

  • simplistic view - icon and abbr of like count

  • with Like coin ID with - icon, give %likecoin ID CTA slogan + abbr of count

  • no count view - icon + CTA slogan

  • round button version with icon and like count

  • round button version with just the icon

  • calls corresponding API to give like coin when pressed

  • calls corresponding API to register liking a content when pressed

Created from Aha! https://oursky.aha.io/features/PUT-22

Image search by keywords [4 days]

Need #1
Needed by #7

  • Support search by keywords / partial keywords (case insensitive)

  • Support search by partial uploader name, case insensitive

  • Paginated API that returns 15 images at a time

  • API Status code / property that tells the client application it's the end page

  • property that tells the client application how many results were returned by the query

  • return basic metadata for each images (profile image link, uploader username, like count)

  • keywords must be 2 - 64 characters, support unicode characters
    Error message:

    The keyword you entered is too long. Please try again with a keyword that's less than 64 characters long

  • Shows loading indicator

  • Shows end page indicator when no more results are returned

  • Do not allow user to search with empty query

  • order image by like count and upload time - if 2 images have the same like count, the one uploaded last will be shown first

Created from Aha! https://oursky.aha.io/features/PUT-3

Project setup

Needed: N/A
Needed by: EVERYTHING - LET THERE BE LIGHT

  • Front end and SSR setup with Nuxt.js and express

    • Bootstrap Nuxt.js with Vue SSR /w Vuex
    • Express with Nuxt.js
  • Backend setup - dockerized approach

    • Express with sequelizejs
    • Setup Dockerfile
    • Setup the docker-compose on IPFS, posgreSQL
  • Front end deployment for IPFS

  • Backend deployment powered by docker

Created from Aha! https://oursky.aha.io/features/PUT-5

Header

Needed: N/A
Needed by #13
Needed by #7
Needed by #3
Needed by #20
Needed by #14
Needed by #16
Needed by #21
Needed by #15

  • Shows icon
  • Link to upload image page
  • Search result page version with a center aligned search bar
  • If valid metamask is detected, shows the correlated user information (profile pic, username, like coin ID), along with links to the user's uploaded image list and link to start uploading new image

Created from Aha! https://oursky.aha.io/features/PUT-1

add auth to route and clean up unused route

Currently no auth is added in most api for development. And there is unused path. I suggest to make a decision which path requires auth and which should be removed. I recommend it is best to do after login task and image upload task.

  • add jwt auth to required path (e.g. upload image)
  • remove unused api (e.g. users list)

Footer

Needed: N/A
Needed by #13
Needed by #7
Needed by #3
Needed by #20
Needed by #14
Needed by #16
Needed by #21
Needed by #15

  • Link to about us page
  • link to introduction page for wordpress plugin
  • link to introduction page for embed code and widget
  • link to support (contact us) page
  • shows copyright notice (PuttyImage is a service powered by Like.co)

Created from Aha! https://oursky.aha.io/features/PUT-4

Metamask / Trust Wallet check

Needed: N/A
Needed by #13

  • Check if metamask is available when user starts a new browsing session (could be home page or other pages)
  • Shows a prompt to tell user to install / connect to metamask if it's not installed / found
  • If user dismisses the prompt, do not warn the user for this session unless the user attempts to start the upload image flow
  • Always check if metamask information is still available when user attempts to upload an image
  • While the modal is shown, user shouldn't be able to interact with page elements under the backdrop overlay
  • For mobile apps, check if Trust wallet app is installed and try to authenticate using it

Created from Aha! https://oursky.aha.io/features/PUT-12

User image list (profile)

  • Same layout and requirements as my image list, just that the images shown should be from a specific user

  • shows information about the user that the images belongs to
    username (likecoin ID

    number of images uploaded?

    profile image

  • empty state (as designed)

Screen Shot 2018-06-28 at 18.08.22.png (https://oursky.aha.io/attachments/6572075471488784936/token/c423c7bd314ba61d5b5a010e236aadce343f29d02dc4a792976100a528dfd9c8.download?size=original)

Created from Aha! https://oursky.aha.io/features/PUT-23

Report image flow

  • choose reason to report
  • add a new row in admin site for reported image
  • A description with more than 4 words must be added to file a report
  • User need to enter a valid email address to submit the report

Screen Shot 2018-06-28 at 18.09.46.png (https://oursky.aha.io/attachments/6572075646997413725/token/1d8dccfa263dfb901d98cd46261dadf365f41a0283fc9c12ac37ac403db30460.download?size=original)
Screen Shot 2018-06-28 at 18.09.49.png (https://oursky.aha.io/attachments/6572075647615673060/token/f3446d41138cae1542478033e4ff220e3e9ec46fff0d297f7b19fa8c921caa85.download?size=original)

Created from Aha! https://oursky.aha.io/features/PUT-24

Masonry grids for showing image list

  • load 5 rows of image results per page
  • Adjust masonry grid sizes upon window resize (tech lead please suggest usable library / approach for this feature)
  • shows load more button at the bottom, clicking it would load an additional 15 images (next page)
  • when image is hovered (desktop), shows uploader, liked stat and use image button on an translucent black overlay
  • when image is tapped for the first time (mobile), shows uploader, liked stat and use image button on an translucent black overlay , opens the image detail modal if user tapped on the empty space again
  • (Desktop) when user clicked on the empty space of the image grid overlay (trigged by hovering), shows the image details modal
  • Image cells max length = 2x width
  • if image is smaller than the grid cell, fill the unused space with grey background

Created from Aha! https://oursky.aha.io/features/PUT-20

Search result page

Need #2
Needed by #13

  • Shows search result page version of header
  • Shows Searching for "%keywordEntered" bar to remind user what results are being shown
  • Shows results in pinterest-like masonry grids that has equal paddings among other images at all sides
  • hide the load more button if user reached the last page, replace it with "Showing all %number of results of %keyword, try another search?"

Created from Aha! https://oursky.aha.io/features/PUT-6

My image list

Need #22
Needed by #11

  • Redirect users to landing page if meta mask is not detected / cannot be correlated to a registered user record
  • shows list of image using search result's masonry grids layout
  • load up to 15 images per page
  • shows load more button if there are more images
  • when there are no more images to be shown, show "Showing %numberOfImages" you uploaded"

Created from Aha! https://oursky.aha.io/features/PUT-13

Confirm error format at API level

There is an initial error handling in #57.

We probably want to write down the expected format to make sure there is one unify error format in all API implementation.

Discussed with @nwingt , he has an error format used in other likecoin project and may take reference of.

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.