Skip to content

DevMehta22/Blog-Graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog-Project

A simple blog project using Node.js, Express.js, MySQL, and GraphQL.

Table of Contents

Introduction

This project is a basic blog implementation with features like creating, updating, and deleting blog posts. It utilizes Node.js, Express.js, MySQL for data storage, and GraphQL for efficient querying.

Getting Started

Prerequisites

Ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/blog-project.git
    
  2. Navigate to the project directory:

    cd blog-project
    
  3. Install Dependencies:

    npm install
    

Database Setup:

Create a MySQL database for the blog project.
Copy the .env.example file to .env and update it with your database credentials.

```bash
DB_HOST=localhost
DB_USER=username
DB_PASSWORD=password
DB_NAME=your_database_name

Running the Application:

```bash
npm start

The server will be running at http://localhost:3000.

Testing GraphQL Endpoints:

Use a tool like Postman or GraphQL Playground to test GraphQL endpoints.

Example GraphQL query:

```bash
graphql
Copy code
{
  getAllPosts {
    id
    title
    content
    comments {
      id
      text
    }
  }
}

Project Structure:

```bash
├── src
│   ├── controllers
│   ├── db
│   ├── graphql
│   ├── routes
│   ├── index.js
├── .env.example
├── package.json
├── README.md
└── ... (other project files)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published