From 29c80e0fe0accaa51d0d57fb8529a8f9f2248e85 Mon Sep 17 00:00:00 2001 From: Dm1tr1y147 Date: Sat, 3 Oct 2020 17:28:39 +0500 Subject: [PATCH] Added basic project structure and Readme --- .gitignore | 9 +++++++++ README.md | 9 +++++++++ package.json | 17 +++++++++++++++++ prisma/schema.prisma | 11 +++++++++++ src/index.ts | 14 ++++++++++++++ src/list.test.json | 5 +++++ 6 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 package.json create mode 100644 prisma/schema.prisma create mode 100644 src/index.ts create mode 100644 src/list.test.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e8ec09 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/node_modules + +/build + +.env.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..307ee58 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# QuestionForm Backend + +Backend used with QuestionForm application. + +# Built with: + +- Prisma +- Graphql +- Graphql-yoga diff --git a/package.json b/package.json new file mode 100644 index 0000000..56f6809 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "backend", + "version": "1.0.0", + "main": "src/index.ts", + "license": "MIT", + "dependencies": { + "graphql-yoga": "^1.18.3" + }, + "scripts": { + "dev": "ts-node src/index.ts" + }, + "devDependencies": { + "@prisma/cli": "^2.8.0", + "ts-node": "^9.0.0", + "typescript": "^4.0.3" + } +} diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..f63f7fb --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,11 @@ +// This is your Prisma schema file, +// learn more about it in the docs: https://pris.ly/d/prisma-schema + +datasource db { + provider = "sqlite" + url = "./dev.db" +} + +generator client { + provider = "prisma-client-js" +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..cc2c64b --- /dev/null +++ b/src/index.ts @@ -0,0 +1,14 @@ +import { GraphQLServer } from "graphql-yoga" + +const typeDefs = `` + +const resolvers = {} + +const server = new GraphQLServer({ + typeDefs, + resolvers, +}) + +server.start(({ port }) => + console.log(`Server is running on http://localhost:${port}`) +) diff --git a/src/list.test.json b/src/list.test.json new file mode 100644 index 0000000..5c1503f --- /dev/null +++ b/src/list.test.json @@ -0,0 +1,5 @@ +[ + { + + } +] \ No newline at end of file