Giter Site home page Giter Site logo

randomeffecttask's Introduction

Developer: Heydarli Atabay

Random Effect Task

It is a simple web application that allows users to upload a picture in various formats (e.g. jpeg, png). Once the picture is uploaded the user can select zero or multiple effects / transformations on the picture. It is finally possible to download the picture.

The application contains of three components, such as DB(MySQL using AWS RDS Cloud service), backend(NodeJs & Express), and frontend(ReactJS).

How to run it:

Use these npm scripts to install and run the project:

  1. clone the repository
  2. cd namedirectory
  3. cd random-effect → npm install
  4. cd .. → cd server → npm install
  5. (open another terminal window) cd server nodemon server.js
  6. cd client → npm start

The application should now run at http://localhost:3000 of the browser

React Client Application Routes

  • Route /: redirects to the route: /homepage
  • Route /homepage: where the main functionality of app was implemented
  • Route /login: where user can authenticate itself

APIs

login api:

  • POST /api/sessions
    • Request parameter:

    • Request body: An object representing (Content-Type: application/json).

    • Body of the content:

      `{
          "id": e.id, 
          "name": e.name, 
           "email": e.email,
          "hash": e.hash, 
      

      } `

    • Response: 201 OK (success) or 401

    • Response body:

      `{ "id": e.id, "name": e.name, "email": e.email, "hash": e.hash, "role": e.role

      }` or

      `{ 'User not found.' } `
      

logout api:

  • DELETE /api/sessions/current
    • Request parameter:
    • Request body:
    • Body of the content:
    • Response:
    • Response body: Logout completed!

get effects

  • GET /api/effects - Getting all effects from DB
    • request parameters:
    • response body: array with effects( { "effect_id": 3, "effect_name":"Flip", "effect_description":"Flips selected image", "effect_type":"effect" } )

add new effects

  • POST /api/effects
    • request parameters and request body content : { "effect_id": 3, "effect_name":"Flip", "effect_description":"Flips selected image", "effect_type":"effect" }
    • response body content : error object or the id of the new form

delete effects

  • DELETE /api/effects/delete/:effectid - Deleting the effect
    • request parameters and request body content : params= effectid
    • response body content : Selected effect with id:${id} was deleted Error while deleting the effect with id:${id} and error object

applying effects to an image

  • POST /api/apply/:effect
    • request parameters and request body content : params: effect Where effect can be: "Flip","ChangeColor","InvertColor","GrayScale","Blur","Sepia" { {formData}: all necesary data of image }
    • response body content : error object or the id of the new form

Database Tables

  • Table Users - contains id email name hash
  • Table Effects - contains effect_id effect_name effect_description effect_type
  • Table Images - contains image_id image image_name user_id

Users Credentials

Email address Password
[email protected] atabay111
[email protected] federico1

Screenshots

Page of non authorized user

Page for non user

Login Page

Login Page

Main Page

Main Page

Flip Effect

Login Page

Invert Color Effect

Login Page

randomeffecttask's People

Contributors

heydarliatabay avatar

Stargazers

Elchin Farhad 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.