Git Product home page Git Product logo

haggle-x-caleb's Introduction

HaggleX URL Metadata Parser GraphQL API

This is a repository of code that creates a simple GraphQL API for parsing and generating webpage metadata when supplied the URL to the webpage.

The metadata is parsed primarily from the Open Graph protocol meta tags and fallbacks to normal HTML meta tags when the OG tags aren't present in the document.

Getting started

Clone and/or fork your copy of this repository to your development machine and change to the working directory of the newly cloned repo haggle-x-caleb.

# Clone this copy
git clone [email protected]:calebpitan/haggle-x-caleb.git
# Or clone your fork
git clone [email protected]:<username>/haggle-x-caleb.git

Change to the new working directory

cd haggle-x-caleb

Install dependencies

Make sure you have Node.js and Docker installed on your development machine. Run:

yarn install

to install the project dependencies and alternatively with npm:

npm install

Starting the app

You can decide to start the app manually, but bear in mind you will need to have Redis installed on your local machine to start it manually as the app depends on a Redis Server to work.

If you don't have Redis installed on your local machine then you can just start the app using Docker and docker-compose which creates an executable OS image of the app bundled with all external required resources and dependencies.

You may create a .env file at the root directory to define and assign values to the environment variables defined in .env.dev which would be loaded when the process starts.

docker-compose up [--build]

The app will listen on a port :3000 by default and the GraphQL API can be acessed at http://localhost:3000/graphql. You can open your preferred browser and hit that address in the address bar to test and introspect the GraphQL API using the in-browser GraphiQL/GraphQL Explorer.

Testing

This app is fully tested with both unit and end-to-end testing. The unit tests can be run on this command:

yarn test

while the integration (e2e) tests can be run on this command:

yarn test:e2e

Debugging

This app is completely debuggable and listens for debugging on a socket connection at port :9229 at a complete address 0.0.0.0:9229 and has the debugging integrated into the VSCode Editor. To debug, run:

yarn start:debug

When the debug server is started, you can set breakpoints in your VSCode editor and send a GraphQL query using the explorer you opened in the browser and watch your VSCode pause the execution at the selected breakpoint for you to inspect live variables and troubleshoot amongst other things.

Deployment

This app is deployed on Heroku using Github Actions as the CI/CD pipeline. The deployment is automated and occurs when a pull request is merged after all tests have passed on the development branch.

The deployment server lives at https://haggle-x-caleb.herokuapp.com/graphql and the playground and intospection are intentionally not disabled.

Thank you!

Copyright & License

Copyright (c) 2021 Caleb Adepitan. MIT Licensed

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.