- Notifications
You must be signed in to change notification settings - Fork99
GraphQL first full-stack starter kit with Node, React. Powered by TypeScript
License
karanpratapsingh/fullstack-starterkit
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Setting up boiler plates when starting new projects is tedious sometimes and I often found myself setting it up from scratch 🥱
Hence I made this starterkit following some of the best patterns and practices I learnt from some of the larger codebase and fantastic developers I've had a chance to work with 🙌
The main purpose of this repository is to provide a scalable "batteries included" full stack starterkit which follows good architecture patterns (might be opinionated) and code decoupling which becomes significant as the project grows or new developers are onboarded
All in TypescriptBecause TypeScript is awesome, and types are important 😃
GraphQL FirstThis starterkit is built with graphql first approach using theApollo platform
Includes CICI is integral part of any project. This starterkit includes
Github Actionsby default. PR's for integration with any other providers are welcome 🙌Docker SupportYou can also use docker to develop and run your applications
Testing FocusedThis project usesJest for testing framework and comes with sample tests which are easy to extend
PrismaPrisma is the ORM being used forPostgreSQL. Feel free to submit a PR for any other ORM or drivers you'd like to see here 😁
PWA SupportThis starterkit comes with out of the box PWA support
Please leave a ⭐ as motivation if you liked the idea 😄
Here's a brief video overview of this project, hope it helps.
Big thanks to@mikestaub for mentoring me on the lot of the ideas you will come across in this repository. Checkout how he's changing social media withPeapods
Here is the folder structure forbackend, it is usingyarn workspaces which helps us split our monorepo into packages such as DB, GraphQL. Which if required can be made into their own micro services.
backend├── build├── config├── logs├── packages│ ├── db│ │ └──prisma│ ├── graphql│ │ ├── api│ │ ├── schema│ │ └── types│ └── utils├── tests│ ├── db│ └── graphql├── index.ts└── package.jsonThis workspace package contains the database abstractions. The database stack isPostgreSQL as relational database andPrisma as an ORM, read more about DB packagehere
The GraphQL package is organized as below:
graphql├── schema│ └── user <---- some entity│ ├── resolvers │ │ ├── types <---- type resolvers│ │ ├── queries <---- query resolvers│ │ └── mutations <---- mutation resolvers│ ├── queries.graphql│ ├── mutations.graphql│ └── types.graphql├── api│ ├── queries │ └── mutations├── types <---- graphql types│ ├── schema │ └── resolvers└── index.jsonThe schema splits each entity into it's own set of schema to modularize the codebase. The graphql package usesschema stitching andcode generators to construct the whole schema.
It is organized so because if you choose to split graphql into it's own set of microservices later, it should be relatively easier to do so as this should be easy to integrate withApollo Federation
Read more about GraphQL packagehere
Here is the folder structure forweb, it is a standardcreate-react-app usingcraco to override configs without ejecting
Web package usesMaterial UI heavily as it makes theming and customization very easy. PR's for any other UI kit are welcome 😃
web├── build├── public├── src│ ├── assets│ ├── config│ ├── constants│ ├── global│ ├── tests│ ├── layout <---- controls, pure components│ ├── theme <---- theme config│ ├── graphql│ │ └── operations.tsx <---- generated graphql operations and types│ ├── pages│ │ └── Home <---- page component│ │ ├── components <---- page specific components│ │ └── hooks <---- page specific custom hooks │ └── utils├── tests│ ├── db│ └── graphql├── index.ts└── package.jsonSetting up environment variables
Before getting started, create.env files at bothbackend/.env as well asweb/.env following the.env.template files located in those directories.
Install dependencies
I recommend usingyarn instead ofnpm as this project heavily usesyarn workspaces
Installvolta, which should automatically install correctnode andyarn version when you checkout the repository (check the root package.json for config)
yarnTo install dependencies forweb andbackend automatically, a postinstall script has been added in the mainpackage.json
Running web
- Docker (recommended)
$ cd web$ yarn devOnce you're done working, useyarn dev:down command to stop the docker containers.
- Locally
$ cd web$ yarn start:webRunning backend
- Docker (recommended)
$ cd backend$ yarn devOnce the container starts, you'll be inside the backend image. Now, simply migrate the db (only first time) and start the development server.
$ yarn migrate$ yarn startOnce you're done working, exit out from the container and useyarn dev:down command to stop the docker containers.
- Locally
$ cd backend$ yarn startNote: When running locally, you'll be required to run your own instance of postgres.
Running backend-go
If you don't havemake installed, commands are available inMakefile.
$ cd backend-go$ make devNow from inside the container, you can run the tests or application like below:
$ make test$ make runCodegen
This starterkit usesgraphql-code-generator to codegen lot of things like TypeScript types, React Apollo hooks and queries, GraphQL Schema AST etc.
cd backendyarn generate:graphqlContributions are welcome as always, before submitting a new PR please make sure to open a newissue so community members can discuss.
Additionally you might find existing open issues which can helps with improvements.
This project follows standardcode of conduct so that you can understand what actions will and will not be tolerated.
This project is MIT licensed, as found in theLICENSE
Built and maintained with 🌮 byKaran
About
GraphQL first full-stack starter kit with Node, React. Powered by TypeScript
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.


