Giter Club home page Giter Club logo

crossbow's Introduction

Serverless crossbow api

Run Status

Tehnologies used :

  • Serverless
  • GraphQL-js
  • Apollo Client

Install & Run

You need to have node 6 or higher installed.

npm install -g serverless
npm i # installs all the node_modules

Use mocked data (keep in mind due hard-coded data the interface might behave not as expected)

npm start

Use live data from the development environment. You need to make sure you have access to your deployed lambda functions. This works only after you deployed it to production.

npm run start:remote

Setup for Production

AWS has global unique bucket names. You need to replace <your-s3-bucket-name> in package.json as well as in the serverless.yml with your own custom name.

Since the URL of the API is unknown until you create a stack, you need to deploy once without expecting the application to work using npm run deploy. After the initial deploy you can see the API url which you need to provide to the URL entry in security.env.prod.

deploy feedback

After these steps you are good to go and with your next npm run deploy your infrastructure should up and running. Visit http://<your-s3-bucket-name>.s3-website-us-east-1.amazonaws.com in your browser.

Developing

If you make changes to the GraphQL schema stop the server, regenerate it and restart the server:

npm start

Testing

We use Jest as a test runner. To run all tests use

npm run test

Security

At Serverless we keep our keys encrypted in the repository. We recommend you to do the same. In our case deploying to a staging and production system is done via a continuous integration system which has the secret to decrypt the necessary file with the environment variables. For demo purposes this repository has an unencrypted file for environment variables at foundation/environment/security.env.local and foundation/environment/security.env.prod.

Multiple package.json

In order to keep the total amount of code uploaded to AWS Lambda small the api directory containing the Serverless service has it's own package.json. This speeds up uploading and also should reduce the cold start time of Lambda functions. You don't have to run npm install manually at any point. It will only happen during deploy, but you need make sure every library you are consuming in your GraphQL endpoint is added as a dependency there.

package.json

  • devDependencies: dependencies used to package the front-end application & running the local environment

api/package.json

  • dependencies: dependencies used on AWS Lambda

crossbow's People

Contributors

edouardmenayde avatar louisgrasset avatar

Watchers

 avatar

crossbow's Issues

Project services

  • Google Drive
  • Dropbox
  • iCloud
  • Trello
  • Slack
  • ? Skype
  • ? Gitter
  • Discord
  • ? Facebook Messenger
  • Facebook Group
  • ? Ludus.one
  • GitHub
  • Gitlab
  • Bitbucket
  • Office 365 free = word online

Switch to serverless backend

Using this boilerplate we could switch to a serverless backend. That means keeping only the graphql parts... That would mean removing sails as a dependency and switch maybe to typescript or babel.

Project ideas

  • Auto generated name
  • Name usage checker for all services
  • Dashboard with services stats
  • Roles such as administrator
  • QR code which enables the user to subscribe to all project's service

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.