Code Monkey home page Code Monkey logo

htv-api's Introduction

Hack the Valley 3 API

powered by gqlgen

Pre-requisites:

  1. Spin up MongoDB docker container:
    $ docker volume create mongo-data
    $ docker network create htv-net
    $ docker run -d --network htv-net -p 27017:27017 -v mongo-data:/data/db --name mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --restart always mongo
  2. Spin up Redis docker container:
    $ docker volume create redis-data
    $ docker run --name redis --restart always -d -p 6379:6379 --network htv-net -v redis-data:/data redis redis-server --appendonly yes

Instructions:

  1. Install and configure Golang for your OS: Here
  2. Clone this repository master branch
  3. cd into the project root
  4. Run the following commands to download the dependencies, verify them and vendor it locally for your projects:
    $ go mod download
    $ go mod tidy
    $ go mod verify
    $ go mod vendor
  5. Set the following environment variables for the MLH Oauth middleware:
    export client_id=some_id 
    export client_secret=some_secret
    export scope=email+education+birthday
    export redirect_uri=http://localhost:8080/v1/auth/callback
  6. Run the following command to start up the graphql playground:
    $ go run ./server/server.go
  7. Modify resolver.go as you go along to add/modify features.
  8. Now on your frontend, redirect the user to the following url to initiate the flow
    (provided you have added http://localhost:8080/v1/auth/callback to the redirect url section for your mlh client id)
    https://my.mlh.io/oauth/authorize?client_id=some_client_id&redirect_uri=http://localhost:8080/v1/auth/callback&response_type=code&scope=email+education+birthday
    
  9. For more information on how gqlgen works, check out the: docs

htv-api's People

Contributors

samhaque avatar gaurav1881 avatar

Watchers

James Cloos 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.