Giter Club home page Giter Club logo

bikes-with-graphql's Introduction

bikes-graphql

Start development

To start the database and nodejs server in development mode, run this command in your terminal:

docker-compose up

If it's your first time starting, or if you have added new migration files. Run this in another terminal tab to migrate the development database:

docker-compose run server npm run migrate up --rm

API documentation

Is available in the Graphiql web interface, visit http://localhost:5000/graphql when the development server is running. See docs tab in top right. You can also look at the test files for usage examples.

Run tests

Run this command:

./scripts/run_tests.sh 

On Windows, run: bash ./scripts/run_tests.sh Todo: make the tests run independently, truncate and arrange/seed database with every test.

Build for production

Run this:

./scripts/build_prod.sh 

Push the image to your docker registry or run in a CI/CD pipeline. When running in your production environment, provide a Postgres connection string in an environment variable called POSTGRES_DB_URL. If you wish to require a password for the officer api, provide the environment variable OFFICER_PW with the password. Make sure to set the environment variable NODE_ENV to production

The architecture

The domains/features (officers, cases and assignments) consists of two or three components: repositories (abstracting away data access from business logic), services (business logic), and resolvers (mapping graphql queries/mutations input to service input). Services can also use an EventsEmitter to dispatch events that are of interest to other features, in order to decouple the features. Using RabbitMQ or similiar for this would be a better choice.

bikes-with-graphql's People

Contributors

mrteapot 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.