Giter Club home page Giter Club logo

imagerepo's Introduction

imagerepo

My vision of this project is to create a base template or "image" of an image uploading platform that I can use for future projects.

One of those future projects involves incorporating a lot of machine learning with uploading pictures such as determine if a photo is "good" or "bad", searching by description/objects, etc.

Features *more currently in development!

Users

Currently, it's a really basic user structure. I wanted to have a url path similar to Instagram's. There is no registration, but I plan to implment that soon!

gif of user demo

Uploading

Working on a progress bar similar to google photos or drive soon!

Note that most of the files I uploaded are large camera photos (~24 MB), so the delay is expected (similar to Google Photos).

gif of uploading demo

Technical:

  1. Files are posted as a list of File objects with FormData.
  2. I use Pillow to preprocess the image and generate a compressed and thumbnail photo
  3. I store all these the compressed image, thumbnail, and raw image into Mongo with the GridFS specification
  4. Image links are returned

Downloading

Working on a progress bar similar to google photos or drive soon!

gif of uploading demo

Technical:

  1. Files are queried for by username
  2. Files zipped into a streaming data response
    • I don't think we can make a progress bar with a streaming response, so I'll have to change that in the future
  3. Zipped file returned

Deleting coming soon!

Running

Docker

Production:

  1. docker-compose up in root PROD=true in the .env file

Develop:

  • Not really a dev workflow at the moment, since not hot reloading --> should be different docker-compose file
  1. docker-compose up in root PROD=false in the .env file

Normal

Frontend:

  1. cd frontend
  2. npm i
  3. npm start

Backend:

  1. cd backend
  2. install requirements in your virtual env of choice!
  3. python3 main.py

Mongo:

  1. Spin up a mongo instance, I used docker with the docker-compose-dev.yml file
  2. Otherwise spin up mongo and fill in the connection details in main.py. I used defaults of port 27017 and user/pass as root/rootpassword

Todos

Features

Optimizations

  • move logic/api calls into parent component
  • disable react dev tools + redux dev tools for production
  • change mongo user/pass to docker secrets and create defined readwrite user, don't use root
  • create dev dockerfiles + dev dockercompose for dev workflow
    • binded volume mounts for hot reloading
  • possibly switch to one nginx instance?
  • implement chunked file uploading frontend
  • implement chucked file reponses
  • optimize image preprocessing --> merge processed file and thumb fail to one function?
  • optimize image stuff --> blobs, urls?

Interesting links/searches about file uploading practices

imagerepo's People

Contributors

matthewgeng avatar

Watchers

 avatar

Forkers

robbiezhuang

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.