GraphQL Blog Server with Node Backend
This Repository contains code for backend of a basic blog application.
📜 Tech-Stack Used:
💾 Installation and usage
- Clone the repo:
https://github.com/am-chourasia/MyBlog.git
- Setup the environement variable from the .env environment given.
- Open the terminal and start the server:
cd server
npm start
- Open the url and start querying :)
📂 Server Folder Structure
.
├── directives // custom directive for authorization
├── helpers // helpers for database connection and authentication
├── model // models for mongoDB database
├── resolvers // resolvers for graphql queries and mutations
└── typeDefs // schemas for graphql server
📑 Overview
The GraphQL Schema provides two objects:
- Users
- Posts
These two objects contains various fields which can be used by frontend.
JWT
Authentication and Authorization for all signed in user with Custom Directive is also provided.
The password entered by user is encripted before being added to the database with the bcrypt
library.
Features that can be added:
- Adding Comments feature for the posts, linking it with users commenting on the post.
- 'Follow' features for users to follow other users.