itransfer@1.0.0

itransfer@1.0.0

iTransfer is a "we transfer like" project to upload files and share them with a short url. Shows a number of main Mantra projects features.

By @mantradev
files

Snapshots

Download with:

$ mantrad download-project itransfer@1.0.0

Or download last version with:

$ mantrad download-project itransfer

Extract project with:

$ tar -xf itransfer@1.0.0.tar.gz

Then install:

$ cd itransfer
$ mantrad install

README.md

iTransfer Mantra seed app

This is a "we-transfer-like" web application developed with Mantra framework.

This seed project can be used as it is, or can be extended from its basic functionality.

This project implements a web site by which any user an upload a file and share it using a short url link.

The user interface is based on Tivo free bootstrap theme.

As all Mantra seeds projects, its purpose is to show best practices when developing Mantra projects and can be used as it is or as starting projects to develop more functionality over it.

Components

iTransfer functionality has been developed using a number of components:

  • apiextend

  • csfr

  • execcommand

  • download

  • files

  • footer

  • forms

  • landing

  • logos

  • mantraapiajax

  • multilanguage

  • oldfilesremover

  • sociallinks

  • swr

  • tempcache

  • upload

  • workflows

apiextend

This is an official Mantra component. Extends Mantra API object with a number of useful libraries (underscore, moment, etc.) and a bunch of useful functions.

csfr

Simple component to generate CSFR tokens and validate them, needed by "forms" component.

execcommand

Simple component to run a bash command. Needed by "files" to run "tar" command when zipping a files repository.

download

This components is used to define a view from where the user can download a file.

files

This component is used to manage a files repository. All files uploaded by the application are stored with this component.

Simple component to define a block with the footer of the web site.

forms

This component exposes an API to generate dynamically forms.

landing

Simple component to define the view for the landing page of the site.

logos

The purpose of this component is just to store web site logos.

mantraapiajax

This component adds to MantraAPI client object a number of methods to call AJAX call to the server. Userd by "forms".

multilanguage

Simple component to allow various languages in the site.

oldfilesremover

This component defines a cron job to remove all the files uploaded older than x seconds, according to the component configuration.

Defines a simple block with social icons and their links.

swr

This is a complex component that allows to send images with differents resolutions.

tempcache

Simple temporal cache with key / values.

upload

This is the main component of the site; defines a view to upload new sites and show its short urls.

workflows

This component implements "workflows" dinamically according to a JSON configuration. Is used to define the form to upload new files.

iTransfer application

This simple project shows a number of key Mantra features.

"upload" component defines the view to upload new files. These files are stored with "files" component and are asociated with a short id, generating an url from where a user can download the file.

"upload" also defines a simple model to save these short ids and files id.

When sharing that unique url and opening it in a browser, "download" component shows the view to grab the file.

"oldfilesremover", runs a cron job periodically to remove old files, so uploaded files are stored at the system for a given time, according to oldfilesremover configuration.

MIT License

Copyright (c) 2022 www.mantrajs.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.