Skip to content

Commit

Permalink
add documentation for media storage filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
George Babarus committed May 23, 2020
0 parents commit 8b3ac5b
Show file tree
Hide file tree
Showing 30 changed files with 817 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
venv
.idea
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
23 changes: 23 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. role:: raw-html-m2r(raw)
:format: html

Introduction
============

Storing media files involve some work when you decide to scale horizontally.
Also having to care about disk space and disk mounting may be useless when you are already using cloud infrastructure.

Using cloud storage like Amazon S3 Storage, Azure Blob Storage, or Google Cloud Storage should be easy to configure and use.

See bellow some of the key advantages of using this Magento 2 extension to integrate with various cloud file storage systems in a platform agnostic manner.


Useful links
============

* https://aws.amazon.com/s3/

Author
======

`George Babarus <https://github.com/georgebabarus>`_
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Binary file added docs/source/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/source/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = ReadtheDocsSphinxTheme
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Empty file added docs/source/_static/.gitignore
Empty file.
9 changes: 9 additions & 0 deletions docs/source/_static/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-54395432-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-54395432-3');
</script>
Binary file added docs/source/_static/migration-to-cloud.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/on-premises-deployment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
7 changes: 7 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "!layout.html" %}


{% block extrahead %}
{{ super() }}
<meta name="google-site-verification" content="HFkKCMbj7JNJkz8cCQcdI-1wvQzt9G5yxqEGKhT9dW0" />
{% endblock %}
56 changes: 56 additions & 0 deletions docs/source/architecture/architecture.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

*******************************************
Extension architecture
*******************************************

.. note::
Before going deeper into the development details, please note that the this Magento 2 module is extending core module interfaces, keeping in mind the backward compatibility and keeping the changes as low asa possible.

.. contents:: Table of Contents

Upload images in admin area
================================

Uploading files form user interfaces or programmatically at product should be compatible with any customization as log as is using Magento standard interfaces.

Nevertheless the business logic is not changed, and cloud storage services are added using regular/local filesystem interface.

.. image:: static/upload-image.jpg
:target: ../_images/upload-image.jpg
:alt: Upload image for product or CMS blocks

.. note::
Uploading products attachments for downloadable products works just like uploading the product image showed in the above schema.

.. note::
Features: :term:`WOOB`


Frontend resized image delivery
================================

Resized images could be delivered directly from storage system after creating the resized image in the main request or return a proxy url responsible to return the image if not exist.

The proxy can be implemented as follow:

* nginx config to request it from storage system and create a fallback request in case of error on Magento resize script
* in case you don't have access to a web server proxy configuration there is a option to return it directly from default Magento image resize script.

.. image:: static/frontend-image-delivery.jpg
:target: ../_images/frontend-image-delivery.jpg
:alt: Upload image for product or CMS blocks

.. note::
:term:`SWSCNO`


Frontend image delivery for original images
============================================

Original images could be delivered directly from storage system, or the CDN in front of it, by configuring the base media url in admin configuration under Store -> Configuration.

.. note::
:term:`WOOB`

.. raw:: html
:file: ./../_static/analytics.html
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8b3ac5b

Please sign in to comment.