Giter Site home page Giter Site logo

beacon-backend's Introduction

beacon-backend

This is the backend for the beacon app. It is written in GraphQL using Apollo and has realtime subscriptions to share user locations with one another. A MongoDB Atlas cluster is used for databasing. You can create your own and put the connection string in the .env file.

master contains all the queries, mutations and subscriptions together for running on a standalone server. The aws branch has been modified to run the API on AWS Lambda which is a serverless platform so no resources are used while idle. This means subscriptions cannot be run since it is serverless, so we have another manager function that starts an ec2 instance while a beacon is active since that is only when subscriptions are necessary, and it pauses the ec2 instance when there is no beacon running. To communicate across Lambda and ec2, redis is used for the pub/sub mechanism.

The serverless framework is used for the Lambda deploys.

The standalone version of the running API may be found at https://beacon.aadibajpai.com which is for development and testing, while the production Lambda is at https://agw4au70ek.execute-api.us-east-1.amazonaws.com/dev/ and the ec2 instance is found at shouldwealiastheiptosomething.

to set up:

  • clone the repo
  • copy .env.sample to .env and fill variables then run:
npm i
npm start

for the serverless stuff, your .env file will be populated to the functions so you only need to do serverless deploy, once you have it installed.

for the ec2 instance, you would want to deploy the normal master branch to a server and set up a cron job or similar that would start the service when the instance is started after it was paused

beacon-backend's People

Contributors

aadibajpai avatar dependabot[bot] avatar aadeesh11 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.