Git Product home page Git Product logo

moosaik's Introduction

๐ŸฆŒ Moosaik ๐ŸฆŒ

Moosaik is a project about creating mosaics with images get from Twitter.

Requirements

  • Git
  • NodeJs & NPM
  • Metapixel
  • MongoDB
  • Docker & Docker Compose
  • Twitter account

How it works

GIFTUH

GIFTUH is a script I made to get images from tweets using a specific keyword. A basic standalone version is available here. I adapt the original code for this program.

Metapixel

Metapixel is a bash program made by Mark Probst that is used to generate mosaics from an original file using all the images recovered with GIFTUH. More informations here

โš  Metapixel does not work well on Ubuntu 18, use preferably Ubuntu 16 โš 

For this reason, I choose to Dockerize the application. I created an app service that use Ubuntu 16 and includes Metapixel. This is defined in the Dockerfile.

Moosaik

Moosaik works by 'projects' you can create and that will be stored in the database. Each project is defined by a name, a summary, an original picture and a keyword.

Using GIFTUH and Metapixel, Moosaik will run and generate a mosaic for the most recent project in DB.

Installation

  • clone repository [email protected]:Pochwar/moosaik.git
  • install dependencies npm i
  • create '.env' file from '.env.example' cp .env.example .env
  • set configuration in '.env' file, at least your Twitter's credentials. But you can also modify default values for App password for creating projects, Mongo credentials, and some other options...

Usage

  • Start up containers with docker-compose up (or docker-compose up -d for detached mode)
  • You can access to Mongo admin at http://localhost:8081
  • In another shell (unless you use detached mode) use docker-compose exec app npm run start to launch the server.
  • Go to http://localhost:2440 to view the default project
  • Go to http://localhost:2440/create to create a new project

Depending on RUN_GIFTUH and RUN_METAPIXEL options in .env file, Giftuh and Metapixel processes will trigger (or not) to find images from Tweets and assemble them into a wonderful "moosaik" :D

Info : Metapixel won't trigger before there are at least 50 images recovered from twitter.

When you create a new project from admin, it will automatically switch to this one. But if you change Metapixel and Giftuh options from .env file, you should stop and restart app by closing "docker-compose exec" instance and relaunch command.

Heroku Deployment

UPDATE : The app is no longer on Heroku, I deployed it here instead : https://moosaik.pochworld.com/

However, I leave the deployment procedure to those who would be interested:

To deploy on Heroku:

  • Add "Apt" buildpack to install Metapixel: heroku buildpacks:add --index 1 heroku-community/apt -a {your-app-name}. Then, Metapixel will be automatically installed as it's referenced in the 'Aptfile'

  • Metapixel have some issues on Ubuntu 18, so it's preferable to set Heroku stack on Ubuntu 16: heroku stack:set ubuntu-16 -a {your-app-name}

Heroku logs are available with this command: heroku logs --tail -a {your-app-name}

TODO

  • Use Giftuh from NPM package (blocked by making Giftuh a NPM package ^^') OR

  • Update Twitter package and check potential issues with path when downloading files (use ${__dirname})

  • prevent Mtpx to run if already running

  • Refacto with TypeScript

  • Make a beautiful front with Vue (or Svelte? or Qwik?)

  • Decouple server / Metapixel / Giftuh

moosaik's People

Contributors

pochwar avatar

Watchers

 avatar  avatar

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.