HighperformaceNext+React+GraphQLstarterkit
Thepurposeofthisstarterkitisottobecompletesolutio,butitroductioforcreatighighperformacewebsiteswithNext.js,ReactadGraphQL.WeusethisrepositoryforewprojectsatAtherosItelligeceadastherepositoryforourarticlesatGraphQLMastery
Cloetherepositorywithgitcloegit@github.com:atherosai/ext-react-graphql-apollo-hooks.gitTopreservesecuredepedeciesipackage-lock.jsousepmcitoistallpackagesNode.jsversioEvethoughthatthestarterkitshouldworkwitholderNodeversios,IwouldsuggesttouselatestNodeLTSversio.Ipackage.jso.Wehavesetrequiremetsasfollows:
"egies":{"ode":">=10.0.0","pm":">6"},Techologies&maifeaturesNext.jsReactGraphQL(Apolloserver)ApolloclietReactApolloHooksNode.jsTypeScriptGraphQLCodeGeeratorJestProductiousageIordertoachievethebestperformaceyoushouldhaveeabledhttp/2adalsoeablecompressioiyourreverseproxy(gix).UptodateNode.jsserverisalsoverybeefitial.
EvirometcofiguratioThesolutioforevirometvariablesisbuiltusigdotevlibraryadtwoevirometvariables.WellkowNODE_ENVvariablecabesetasdevelopmetorproductioadourCUSTOM_ENV,whichdefiestheeviromet.Thiscabeyourstagig,productio,localevirometoreveyourbuildserver.Thesetwovariablesdefietheameof.evfilei/secretsfolderthatwillbeused.Ifwewouldliketoforexampledefiethecofigforourstagigevirometwewouldcreatethefilecalled/secrets/productio-stagig.evadplacealltheevirometvariablesthere.Theexampleforsuchafilecabeforexamplethefollowigthatwecausefordevelopmet
NODE_ENV=developmetCUSTOM_ENV=localPORT=3000API_URL=https://localhost:3000/graphqlHOST=https://localhost:3000SecurityadauditYoucarusecurityauditodepedecieswith.Besurethatyouusepackage-lock.jsoiourrepository.
pmaudit







评论