synycboom / stickery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stickery

A dapplet that puts stickers on posts using the Dapplets Project infrastructure. This is a bounty project from https://gitcoin.co/issue/ridgerock/stickery/1/100027435.

Demo

Project Structure

  • root folder contains the main dapplet.
  • adapter contains a dapplet code which handles twitter and instagram droppable points for stickers.
  • overlay contains an overlay code which handles authentication, sticker selection, etc.
  • server contains a server side code providing APIs

Project Architecture

dapplet-setup-1

Project Setup

This project requires NodeJS V14. First, after pulling the repo, we have to install all dependencies.

# 1. Install the main dapplet dependencies
$ npm ci

# 2. Install the server dependencies
$ (cd server; npm ci)

# 3. Install the over dependencies
$ (cd overlay; npm ci)

# 4. Install the adapter dependencies
$ (cd adapter; npm ci)

The next step we will setup environment variables

$ cat server/.env.example > server/.env
$ cat overlay/.env.example > overlay/.env

Since our server uses MySQL, in our development we can run a provided docker compose file to start DB and its admin UI.

$ docker-compose -f server/docker-compose.db.yaml up -d

Run migration scripts to create tables and insert seed data

$ cd server
$ npm run migrate:up
$ npm run db:fixtures
$ cd ..

Run all services together

# Assume that we are in the root project directory
$ npm run start

Dapplet Setup

After setup was done, we will install dapplet extension. Please follow the steps in https://docs.dapplets.org/docs/installation

  1. Open extension and add http://localhost:3001/dapplet.json and http://localhost:3002/dapplet.json as development servers in Developer tab. It should show two records at #2 in the picture below.
dapplet-setup-1
  1. Go to Dapplets tab and enable stickery dapplet (before doing this step, we have to visit either www.twitter.com or www.instagram.com)
dapplet-setup-1

In case the dapplet is not running, please deactivate and re-activate it again.

Deployment

There are configs that have to be changed when deploying to production.

  • In dapplet.json, edit the overlay url to where the overlay is deployed.

About

License:MIT License


Languages

Language:TypeScript 94.1%Language:JavaScript 3.1%Language:HTML 1.9%Language:CSS 0.7%Language:Shell 0.2%