Git Product home page Git Product logo

weekend-react-gallery's Introduction

Image Gallery

Description

The objective of this weekend challenge was to build an image gallery that uses React as the main building block of the user interface components. We were asked to display images that are significant to us.

I chose to build a gallery of bird images because being outdoors has always been a big part of my life. I used to go bird watching with my parents as a child and enjoyed it very much.

Image gallery requirements:

  • DISPLAY images from the relational database and display on the front-end.
  • allow a user to ADD an image to the image gallery.
  • allow a user to DELETE an image from the image gallery.
  • allow a user to UPDATE an image by clicking on the "love" button.
  • allow a user to VIEW the image description by clicking on the image.

The base mode took me approximately 5 hours. The completed application (with stretch goals & Bootstrap styling) took me a full 15 hours to do.

Note 1: Images themselves are not stored in the database. Rather, a path to the image is stored.

Note 2: At this time, only images from the internet (with URL) can be added to the image gallery. A future challenge would be to allow a user to add an image from another source (local drive, Google drive, dropbox, etc).

Application Demo

Image Gallery application

Screenshot of Database

Image Gallery database

Prerequisites

The following should be installed before attempting to use the image gallery:

  • Express - a web framework for Node.js
  • Postgresql - an open source relational database

Installation

In order to get the image gallery application up and running, do the following:

  1. Download code locally from GitHub.
  2. Create the database and corresponding table by doing the following:
  • Using your favorite relational database client (I use Postico(https://eggerapps.at/postico/), go to the SQL Query tab that allows you to run a query. Using the queries from the Create Database.sql file, do the following:
  • Run the 'CREATE DATABASE' query. This will create the react_gallery database.
  • Then, within the react_gallery database, run the 'CREATE TABLE' query. This will create the tasks table.
  • Finally, run the 'INSERT INTO' query. This will insert a few images into the database for the web application to use.
  1. Launch the application locally.
  • Go to your terminal and type 'npm run server'. This will start a local server on port 5000.
  • Go to your terminal and type 'npm run client'. This will start a client session in your broswer on port 3000.

Usage

  1. A user can add a new image by entering the image URL(required) and image description into the input fields. The image is saved to the database by clicking on the 'Add' button. The gallery of images will be updated with the new image.

  2. A user can "love"" an item by clicking on the heart button. This will increase the number of people who love the image by 1.

  3. A user can view the image description by clicking on the image.

  4. A user can delete an image from the gallery by clicking on the garbage can button. The image will be deleted from the database.

Built With/Using

  • HTML
  • CSS
  • Bootstrap
  • Sweetalert2
  • React
  • JavaScript
  • Axios
  • Express
  • Postgresql

Acknowledgement

  • Thanks to our fearless instructor, Dev Jana! His easy-going nature and patience are truly what make him a great teacher.
  • Thanks to Prime Digital Academy for providing all Prime students with the opportunity to make substantial changes in their lives by learning how to program and how to think like a programmer.

Support

  • Thank you to my fellow Ionian cohort members for interesting conversations about how to make our projects work. They all offer interesting thoughts, ideas and approaches. Best of all, they are awesome human beings!

If you have suggestions or questions, please email me at [email protected].

weekend-react-gallery's People

Contributors

jenny-alexander 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.