Giter Site home page Giter Site logo

aryawpratama / apollographql-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 3.0 36 KB

Boilerplate for graphql and graphql-ws using Apollo Server Express and powered by TypeORM and TypeGraphQL to make your work is quicker and easier.

License: MIT License

Shell 1.74% JavaScript 4.01% TypeScript 94.25%
node express typescript graphql typeorm typeorm-seeding apollo-server boilerplate rbac-authorization graphql-ws

apollographql-boilerplate's Introduction

Apollo Server Express Boilerplate

Boilerplate for graphql and graphql-ws using Apollo Server Express and powered by TypeORM and TypeGraphQL to make your work is quicker and easier.

Made with ๐Ÿ’• by Arya W Pratama

I hope you like it! ๐Ÿ˜‰

Powered by

Features

  • Basic JWT Login and Register System.
  • Role Based Access Control Guard.
  • GraphQL WebSocket with graphql-ws.
  • Database Faker with Faker and TypeORM Seeding.
  • graphql-ws, client example in graphqlwsclient branch.
  • Path Alias.
  • TypeGraphQL.
  • Typescript. โค๏ธ
  • Build helper, to make your build folder clean.
  • ESLint Airbnb.

How to Use

  1. Rename .env.example to .env
  2. Fill the .env with your own configuration
  3. Run yarn or npm install to install the dependencies
  4. Run yarn seed or npm run seed to seed your database
  5. Finally run yarn dev or npm run dev to start the server in Development Mode

Command Explanation

  • yarn build or npm run build
    • Build your project, the output will be in /dist directory
  • yarn dev or npm run dev
    • Start your server in Develompent Mode
  • yarn staging or npm run staging
    • Start your server in Develompent in Staging Mode Make sure you build your project first
  • yarn production or npm run production
    • Start your server in Develompent in Production Mode Make sure you build your project first
  • yarn seed or npm run seed
    • Seed your database
  • yarn schema:sync or npm run schema:sync
    • Sync your entities with your database
  • yarn schema:drop or npm run schema:drop
    • Drop all of your table in your database
  • yarn migration:run or npm run migration:run
    • Migrating Database
  • yarn migration:revert or npm run migration:revert
    • Revert database Migration
  • yarn database:refresh or npm run database:refresh
    • Refresh your database with new table and data

Important Account

  1. Admin
  2. Organizer
  3. User

Note

  • You may use another database like oracledb, mariadb, postgresql, etc. Just remove the mysql dependency and install your own database dependency as long as typeorm support it.
  • I have installed graphql-ws to make your work easier, just disable it if you don't want graphql subscription run in your project.
  • I use id_ID for default user faker data, just change the locale in @factories/dummyUser.factory.ts directory.
  • I've setup path alias in this project, you may found and edit it by your own decision in tsconfig.json
  • I'm not an expert so I might make a lot of mistake, I just want to make your work is easier. Your feedback would make me be a better developer! โค๏ธ

apollographql-boilerplate's People

Contributors

aryawpratama avatar

Stargazers

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