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
- 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.
- Rename
.env.exampleto.env - Fill the
.envwith your own configuration - Run
yarnornpm installto install the dependencies - Run
yarn seedornpm run seedto seed your database - Finally run
yarn devornpm run devto start the server in Development Mode
yarn buildornpm run build- Build your project, the output will be in
/distdirectory
- Build your project, the output will be in
yarn devornpm run dev- Start your server in Develompent Mode
yarn stagingornpm run staging- Start your server in Develompent in Staging Mode Make sure you build your project first
yarn productionornpm run production- Start your server in Develompent in Production Mode Make sure you build your project first
yarn seedornpm run seed- Seed your database
yarn schema:syncornpm run schema:sync- Sync your entities with your database
yarn schema:dropornpm run schema:drop- Drop all of your table in your database
yarn migration:runornpm run migration:run- Migrating Database
yarn migration:revertornpm run migration:revert- Revert database Migration
yarn database:refreshornpm run database:refresh- Refresh your database with new table and data
- Admin
- username : admin@example.com
- password : admin
- Organizer
- username : organizer@example.com
- password : organizer
- User
- username : user@example.com
- password : user
- You may use another database like oracledb, mariadb, postgresql, etc. Just remove the
mysqldependency 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.tsdirectory. - 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! ❤️