Simple Demo Application
API built with Node + Express + GraphQL + Sequelize (supports MySQL, Postgres, Sqlite and MSSQL).
WebApp built with React + Redux.
Written in ES6 using Babel + Webpack.
git clone git@github.com:atulmy/fullstack-graphql.git fullstack-graphql
cd api
and npm install
cd web
and npm install
/api/src/config/database.json
for database credentials/api/src/config/config.json
for API port (optional)/web/.env
for web port (optional)cd api
and npm start
, browse GraphiQL at http://localhost:8000/cd web
and npm start
, browse web at http://localhost:3000/[nodemon] starting `babel-node src/index.js --presets es2015,stage-2`
SETUP - Connecting database...
SETUP - Loading modules...
SETUP - GraphQL...
SETUP - Syncing database tables...
INFO - Database connected.
INFO - Database sync complete.
SETUP - Starting server...
INFO - Server started on port 3000.
Video: MOV
fullstack-graphql
├── api (api.example.com)
│ ├── src
│ │ ├── config
│ │ ├── models
│ │ ├── schema
│ │ ├── setup
│ │ └── index.js
│ │
│ └── package.json
│
├── web (example.com)
│ ├── public
│ ├── src
│ │ ├── components
│ │ ├── setup
│ │ └── index.js
│ │
│ ├── .env
│ └── package.json
│
├── .gitignore
└── README.md
/api/src/models/thought.js
to /api/src/models/user.js
and modify the file for table name and respective fieldsmodels
object in /api/src/models/index.js
/api/src/schema/thoughts
to /api/src/schema/users
and modify type.js
, resolvers.js
and fields/query.js
and fields/mutations.js
/api/src/schema/users/fields/query.js
in /api/src/schema/query.js
/api/src/schema/users/fields/mutations.js
in /api/src/schema/mutations.js
users
under /web/src/components/
/web/src/components/users
api
folder under /web/src/components/users
actions.js
where all your Redux Action Types and Actions will reside (refer /web/src/components/thoughts/api/actions.js
)state.js
where all your respective Reducers will recide (refer /web/src/components/thoughts/api/state.js
)/web/src/setup/store.js
to make it avaliable to the app/web/src/components/users
/users
):
routes
object in /web/src/setup/routes.js
(eg user: { list: '/list' }
)/web/src/components/App.js
and add the route entryThese queries are generated on client side using queryBuilder()
helper defined in /web/src/setup/helpers.js
Query - Get List query { thoughts { id, name, thought } } |
Response { "data": { "thoughts": [ { "id": 1, "name": "Arya Stark", "thought": "A girl has no name" }, { "id": 2, "name": "Jon Snow", "thought": "I know nothing" } ] } } |
Query - Get by Param query { thought(id: 1) { id, name, thought } } |
Response { "data": { "thought": { "id": 1, "name": "Arya", "thought": "A girl has no name" } } } |
Mutation - Create mutation { thoughtCreate( name: "Tyrion Lannister", thought:"I drink and I know things" ) { id } } |
Response { "data": { "thoughtCreate": { "id": 3 } } } |
Mutation - Remove mutation { thoughtRemove(id: 3) { id } } |
Response { "data": { "thoughtRemove": { "id": null } } } |
Facebook Groups:NodeJS • ReactJS • GraphQL
Reddit:NodeJS • ReactJS • GraphQL
Following projects have been built with or inspired from fullstack-graphql
If you liked this project, please donate to support it
Copyright (c) 2017-18 Atul Yadav http://github.com/atulmy
The MIT License (http://www.opensource.org/licenses/mit-license.php)
最开始的时候是计算机软、硬件都需要懂,这时候的程序员叫电子科学家。 后来软硬件分离,但是仍然要对硬件精通,这时候的程序员叫计算机科学家。 软件飞速发展,软件成为一个单独的门类,这时候的程序员才叫程序员,也就是软件开发。 最开始时需要对数据库,对UI开发都要会。一个人需要会所有的技术。 随着浏览器的发展和分工的细化,开始有前端、后端区分。前端(浏览器端和手机端)专注于画面的展示,后端专注于业务逻辑。
目录 Grahql 要点 定义数据类型 type XXX example: type Book { id: ID title: String author: Author // 自定义类型 summary:String isbn: Int test: Boolean } 定义查询 api type Query example: type
Fullstack GraphQL Boilerplates for React & Node.js Bootstrap your fullstack GraphQL app within seconds GraphQL boilerplates provide the perfect foundation for your GraphQL server, no matter if you're
A complete, serverless, full-stack application built on AWS Lambda, AWS HTTP API, Express.js, React and DynamoDB. Live Demo: https://www.serverless-fullstack-app.com Quick Start Install the latest ver
Vue fullstack template This project's goal is to help people create a reactive, realtime and user friendly backend system. �� Vue version This template only support vue2, because it use ElementUI as t
Apollo tutorial This is the fullstack app for the Apollo tutorial. �� File structure The app is split out into two folders: start: Starting point for the tutorial final: Final version From within the
Relay Fullstack is a Relay scaffolding application that aims to help you get up and running a project without worrying about integrating tools. It comes with many modern technologies; Relay, GraphQL,
Motivation ⭐ 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 pat