Giter Club home page Giter Club logo

assetmanager's Introduction

The Asset (file) Manager app is made up of a static web frontend with lambda functions serving the backend.

The user lands on the index.html page and from there proceed to register. It’s important to point out that he/she needs to register with a real address since the app will send out an email with verification code needed in to validate the account.

After that, the user is taken to the asset-manager page where she/he can upload, download or delete asset(files).

I decided to code the backend in Python since it’s what I’ve been coding lately, therefore given, the timeframe, it’s the most logical decision.

Backend

The Asset Manager app is built on top of AWS, the services used are

  • S3

    • Stores the files uploads
  • Lambda

    • Implements the service operations, four lambdas are used. signed_upload, signed_download, get_list, delete. These are located under the "backend" folder the upload.py files contains an custom implementation to upload a file but it falles short compared with the used and final approach of using signed url.
  • API Gateway

    • Expose Lambdas
  • Cognito

    • Allows the user-based authorization and authentication.

Flow example:

Frontend

In the frontend I use Boostrap and javascript. There are five pages in total.

  • index.html : landing page

  • signin.html: signin page

  • register.html: new user registration

  • verify.html: account verification

  • asset-manager.html: this is the important page and where the calls are made to the backend

Asset Manager page

In this page the user has four main areas:

Token:

Needed for API calls

Upload Feature:

Select a file and using the Browse button, then upload it using the upload button. If succeeded it will display a notification with the corresponding file id needed when downloading a file using the Download feature explained below

Example:

Download Feature:

Allows to download a file using the file id obtained during the Upload process, (explained above)

Listing Feature:

Here I show a list of the current files allowing to download or delete a determined file, the download options reuse the same download process explained above.

Backend We call the backend api using ajax requests, in this form:

                function delete_file(file_id) {
                    var full_url = delete_file_endpoint + '?file_id=' + file_id;

                    $.ajax({
                        url: full_url,
                        type: 'DELETE',
                        crossDomain: true,
                        headers: {'Authorization': $('#token-area').val()},

                        success: function (result) {
                            if (result.success) {
                                console.log('' + result.message);
                                refresh_s3_table();
                            }
                        }
                        ,
                        error: function (error) {
                            console.log(error)
                        }
                    });

                }

Where the 'Authorization' header is the Token to authorize the call, refer to the backend documentation

assetmanager's People

Contributors

e-g-c avatar

Watchers

 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.