Giter Site home page Giter Site logo

word-colors's Introduction

Word to Colors Generator

This app takes in a word (or a phrase) as input and shows you associated colors of the object that the word or phrase represents.

Link to app UI deployed on cloud - https://ragav-word-colors.netlify.app

Link to the API deployed on the cloud - https://word-colors-api.herokuapp.com

Link to API code - https://github.com/ryarasi/word-colors-api

Basic info

  • This project was generated with Angular CLI version 13.1.2. using Node version v14.17.0.
  • The project is built for deployment as a static site for network optimization using Scully
  • This project is integrated into CI via Netlify
  • This project has been hosted on the cloud via Netlify at the link listed above
  • This code repo is configured to automatically update the deployment via Netlify's CI service
  • For a closer look at the method used to achieve the backend functionality, visit the API repo

Notable packages

  • Scully - used for converting our Angular app into a static site, needed to deploy our Angular app to the cloud using JAMstack
  • Angular Material - Used for tooltips and clipboard feature
  • ngneat/hot-toast - Used to show the toast messages when color codes are copied to clipboard

Methodology

  • When you enter the word, we send a GET request to the API with the search term, and in the response we get an array of upto 10 image urls along with an array of dominant colors for each of those images.
  • The API has means to access the Google Custom Search API, which it uses to search for images for the query.
  • When the images return, we use the Ximilar API package to get an array of dominant colors as hex codes.
  • The API then neatly organizes the image links and the dominant colors for each image into a JSON and sends it back.
  • Finally based on the response, we present a masonry grid with the first dominant color in the array overlaid on top of the image.
  • The user has the additional option to click on the "Not satisfied?" option to switch to a possible secondary color chosen as the dominant color, although the first color tends to be the most accurate most often.
  • The user also has the means to toggle the images on, to see which image the suggested color was obtained from.
  • Note that safe search is activated, so any NSFW terms may potentially not lead to any results

How to run this app on your local machine

  • Download the code of this repository to your local machine
  • Make sure you've got Node v14 installed. Use the specific version above to avoid potential compatibility issues. Instructions
  • Install Angular CLI globally Instructions
  • Open the terminal and change directory into the code directory and type npm install to install all the necessary dependencies
  • Once all the dependencies are installed, type npm start to run the project locally. The application will be served at http://localhost:4200/ by default.
  • Make sure to also run the API application in your local machine for it to work properly.

How to deploy this to the cloud via Netlify

  • Create your Netlify account if you don't have one already
  • Sign into your account and create a new project. You can either upload your fields directly or connect your Git account (GitHub or GitLab). The latter is preferred.
  • Once you connect your account, select the repo of this project. You must have already pushed this repo to your account.
  • While setting up the repo, you will be asked to set the publish directoryand build command. Use dist/static/ and build:production respectively.
  • Once this is set, you can either manually trigger deploys or alter the settings to enable automatic deployments when changes are pushed to a specific branch.Detailed instructions

word-colors's People

Contributors

ryarasi 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.