karanpratapsingh / fullstack-starterkit Goto Github PK
View Code? Open in Web Editor NEWGraphQL first full-stack starter kit with Node, React. Powered by TypeScript
License: MIT License
GraphQL first full-stack starter kit with Node, React. Powered by TypeScript
License: MIT License
I've been following the setup, but I'm web / yarn dev docker hangs and localhost:3000 is not accessible. I just see Attaching to web, and nothing else happens. Any ideas?
It would be nice if we can have more options on the backend side for boilerplate because I've seen people struggling on the backend side where they don't really want to use JS/TS. So it will be nice if we can implement the backend boilerplate using C#.
I've been working on creating a GraphQL API using .NET 5 (ongoing) - Socialize API. So happy to help on the implementation part.
I have followed the steps as mentioned but it gives below error..
I have install dependencies using yarn to the root of the project and also change the database parameters to my local enviroemnents and then fire yarn start:backend
command but getting below error. can you please look this issue and let me know the steps please.
Error: Cannot use e "__Schema" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
The readme claims that types are important.
I agree with that and I think this repo doesn't do the type safety justice. It really needs to have https://graphql-code-generator.com/ set up. Please include it in here. Most people don't know how to set it up from scratch and only by using that you can get 100% fullstack typesafety.
If you don't know how to set it up, would you accept a PR with it?
Cypress is a really good E2E testing framework
Consider using Lerna to manage the packages. It comes with some neat features like hoisting, etc that you may find useful
I was thinking that we can add a devDependency
to concurrently and start both components at the same time. What do you think? I have a commit ready to be submitted to PR
When I run yarn
command, I get this
Yarn version:
1.22.4
Node version:
12.13.1
Platform:
linux x64
Trace:
Error: https://registry.yarnpkg.com/@pm2/js-api/-/js-api-0.6.0.tgz: Request failed "404 Not Found"
at ResponseError.ExtendableBuiltin (/home/venkat/.yarn/lib/cli.js:696:66)
at new ResponseError (/home/venkat/.yarn/lib/cli.js:802:124)
at Request.<anonymous> (/home/venkat/.yarn/lib/cli.js:67057:16)
at Request.emit (events.js:210:5)
at Request.module.exports.Request.onRequestResponse (/home/venkat/.yarn/lib/cli.js:141625:10)
at ClientRequest.emit (events.js:210:5)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
at TLSSocket.socketOnData (_http_client.js:456:22)
at TLSSocket.emit (events.js:210:5)
Thanks for this starter it's really useful when you want to level up on graphql.
It would be quite useful to provide a small tutorial on how to add new models and use them in the client. There is quite a few scripts to run, generated files, and I think that a few lines in the REAMDME would flatten the learning curve quite a lot.
For ex: I want to create a list of todos, and display it in the client somewhere.
After following the instructions in the readme, I am having an issue with installing the backend dependencies. Please see the output from terminal below.
$ yarn
yarn install v1.22.5
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized loc
k files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > [email protected]" has unmet peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "apollo-server-express > [email protected]" has unmet peer dependency "graphql@^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > [email protected]" has unmet peer dependency "graphql@>=0.10.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^14.2.1 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has unmet peer dependency "[email protected] - 14".
warning "apollo-server-express > graphql-tools > [email protected]" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "apollo-server-express > graphql-tools > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "workspace-aggregator-7d3ab4bd-a8ea-40e1-aad1-ca4a9144a6ec > @project-backend/graphql > @graphql-codegen/[email protected]" has unmet peer dependency "graphql-tag@^2.0.0".
warning "workspace-aggregator-7d3ab4bd-a8ea-40e1-aad1-ca4a9144a6ec > @project-backend/graphql > graphql-tools > @graphql-tools/links > [email protected]" has unmet peer dependency "subscriptions-transport-ws
@^0.9.0".
[4/4] Building fresh packages...
[9/9] ⠈ @project-backend/db
[-/9] ⠁ waiting...
[-/9] ⠁ waiting...
[-/9] ⠁ waiting...
error C:\Users\Dev\Desktop\fullstack-starterkit-master\backend\node_modules\@project-backend\db: Command failed.
Exit code: 1
Command: yarn generate
Arguments:
Directory: C:\Users\Dev\Desktop\fullstack-starterkit-master\backend\node_modules\@project-backend\db
Output:
yarn run v1.22.5
$ yarn prisma generate --schema=./prisma/schema.prisma
$ C:\Users\Dev\Desktop\fullstack-starterkit-master\backend\node_modules\@project-backend\db\node_modules\.bin\prisma generate --schema=./prisma/schema.prisma
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module 'C:\Users\Dev\Desktop\fullstack-starterkit-master\backend\node_modules\node_modules\@prisma\cli\build\index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
error Command failed with exit code 1.
I am unable to access prisma back end API from client app . Invocation fails with OpenSSL issue .
Can you please help me to fix this?
OS: Ubuntu 20.04
I have changed the binaryTargets to
generator client {
provider = "prisma-client-js"
binaryTargets = ["debian-openssl-1.1.x"]
}
Query I am trying to execute is working fine in backend test package, but failed when same is requested from client,
Code executed from client is,
const { data, loading, error } = useGetUserQuery({
variables: {
input: { id: 'abc' } // value for 'input'
}
});
console.log('data', data, loading, error);
Error stack traces are ,
Invalid prisma.user.findUnique()
invocation:
spawn node_modules/.prisma/client/query-engine-debian-openssl-1.1.x ENOENT, Location: [object Object], Path: getUser index.ts:28
data undefined true undefined index.tsx:48
data undefined false Error:
Invalid prisma.user.findUnique()
invocation:
spawn node_modules/.prisma/client/query-engine-debian-openssl-1.1.x ENOENT
ApolloError index.ts:49
getQueryResult QueryData.ts:366
node_modules vendorsmain.chunk.js:7062main.chunk.js:7001
node_modules vendors
result useBaseQuery.ts:65
useDeepMemo useDeepMemo.ts:18
useBaseQuery useBaseQuery.ts:64
useQuery useQuery.ts:12
useGetUserQuery operations.tsx:185
Welcome index.tsx:43
React 9
unstable_runWithPriority scheduler.development.js:468
React 5
onNewData useBaseQuery.ts:38
promise callbackonNewData useBaseQuery.ts:38
error QueryData.ts:305
notifySubscription Observable.js:140
onNotify Observable.js:179
error Observable.js:240
iterateObserversSafely iteration.ts:13
iterateObserversSafely iteration.ts:13
error ObservableQuery.ts:620
iterateObserversSafely iteration.ts:13
iterateObserversSafely iteration.ts:13
error Concast.ts:185
notifySubscription Observable.js:140
onNotify Observable.js:179
error Observable.js:240
promiseQueue asyncMap.ts:44
promise callbackmakeCallback/< asyncMap.ts:42
notifySubscription Observable.js:135
onNotify Observable.js:179
next Observable.js:235
iterateObserversSafely iteration.ts:13
iterateObserversSafely iteration.ts:13
next Concast.ts:171
notifySubscription Observable.js:135
onNotify Observable.js:179
next Observable.js:235
next index.ts:56
notifySubscription Observable.js:135
onNotify Observable.js:179
next Observable.js:235
createHttpLink createHttpLink.ts:153
promise callback*createHttpLink/</< createHttpLink.ts:149
Subscription Observable.js:197
subscribe Observable.js:279
onError index.ts:37
Subscription Observable.js:197
subscribe Observable.js:279
complete Concast.ts:210
node_modules vendorsmain.chunk.js:9413main.chunk.js:4562
Concast Concast.ts:83
node_modules vendors
node_modules vendorsmain.chunk.js:4598main.chunk.js:4783
resultsFromLink QueryManager.ts:1091
node_modules vendors
fromVariables QueryManager.ts:966
index.tsx:48
Worker registration successful http://localhost:3000/
NODE_ENV
set to 'production' will result in a failing yarn
Indeed the postinstall
steps depends on devDependencies
which won't be available in production.
Changing postinstall
step in prepare
could be an option to consider.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.