Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iyashwantsaini/mern_event_booking
A complete MERN stack + GraphQL application
https://github.com/iyashwantsaini/mern_event_booking
expressjs graphql mern-stack mongodb nodejs
Last synced: about 11 hours ago
JSON representation
A complete MERN stack + GraphQL application
- Host: GitHub
- URL: https://github.com/iyashwantsaini/mern_event_booking
- Owner: iyashwantsaini
- License: mit
- Created: 2020-06-26T05:47:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T02:50:11.000Z (over 1 year ago)
- Last Synced: 2023-03-05T13:10:13.854Z (over 1 year ago)
- Topics: expressjs, graphql, mern-stack, mongodb, nodejs
- Language: JavaScript
- Homepage:
- Size: 1.38 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MongoDB+Express+React+Node+GraphQL
A complete Event Booking Application using MERNG
### Rest API
- Stateless ,client independent API for data exchange.
- We always send all data back to the client from an endpoint.
- If we want some less data we'll need to create a new endpoint in backend or we'll send parameters for the data we need.
- GET/POST/PUT/... requests.
- Routes & Controllers.### GraphQL API
- Stateless ,client independent API for data exchange with higher query flexibility.
- No problem here regarding queries (very flexible).
- Only POST requests for every type of request to one single endpoint.
- Operation definitions and Resolvers.
- graphQL is a typed language.
- Eg. Query Language```
{
query { //operation : type
user{ //operation : endpoint
name //requested fields
age
}
}
}
```### Operation types in GraphQL
- Query -- "for GET"
- Mutation -- "for POST/PUT/PATCH/DELETE"
- Subscription -- "setup realtime connection with sockets"### Design
- Event booking API
1. Event - Create, Update, Delete, View(Read)
2. Users - Connected to events
|| Filters -- CreatedBy, Booked
|| BooksEvents, Cancel Booking### Packages
- npm install --save express body-parser
- npm install --save-dev nodemon
- npm install --save express-graphql graphql
- npm install --save mongoose- npm install --save bcryptjs
- npm install --save jsonwebtoken
### Run
- prod -- node app.js
- dev -- npm start(uses nodemon)### To kill all node ports
- killall node
### Error Fixes
- if graphiql not working try on "http" instead of "https"
### Remember
- Dates are passed via "new Date().toISOString()"### CORS
- remember to set CORS policy to server
## License
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
By [Yashwant](https://github.com/iyashwantsaini)
## Contributors