Coder Social home page Coder Social logo

codefiction-stats-graphql's Introduction

Codefiction Stats Project

The project has two different application in this mono-repo project, and using lerna to maintain the dependencies and flow.

Bootstrapping the dependencies using Lerna

Lerna helps you run npm scripts for both projects. Bootstrapping is the first step to install the project dependencies. It will basically run the npm install for both projects.

npm install
npm run bootstrap

Running both projects

If you want to run the both projects together using lerna,

npm run start:all

This will kick npm start on both projects. But you need to satisfy the environment variable for the lambda project before running the application. See the next sub-section for further details.

Running the graphql application

Graphql lambda function is designed to make several requests to different services and aggregate the responses into one single HTTP response. The project is using Apollo Server to serve the graphql POST requests.

In order to succesfully run the full fledged graphql aggregator you need to create a file named .env under the ./packages/stats-lambda/ folder. Then put the required environment variables into it. You can checkout the .env.sample as an example.

SECRET=SECRET
YOUTUBE=SECRET
YOUTUBE_KEY=SECRET
TWITTER_CONSUMER_API_KEY=SECRET
TWITTER_CONSUMER_API_SECRET_KEY=SECRET
TWITTER_ACCESS_TOKEN=SECRET
TWITTER_ACCESS_SECRET=SECRET
AMAZON_AWS_ACCESS_KEY=SECRET
AMAZON_AWS_ACCESS_SECRET_KEY=SECRET
ENGINE_API_KEY=SECRET

After satifying the environment variables you can simply run the following command in the root folder to start the application.

npm run start

Running the React pages

React application is the single page application that displays the results aggregated by the Graphql Server.

In order to run the application using lerna run the following command.

npm run start:react

React application is using the react-scripts. You can do whatever react-scripts allows you to do.

The deployment of components

Docker Container

Why docker?

Why not?

Run the application

Read the Running the graphql application section before continue and make sure you have created the .env file.

To run the both containers run the docker-compose up command. This will brought up two docker containers for each application.

codefiction-stats-graphql's People

Contributors

msusur avatar ozaydinb avatar uguratar 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.