This repository contains the GraphQL API backend for a blog application, offering user authentication, registration, post management, and role-based authorization features. The API is designed to integrate seamlessly with a frontend application, providing a secure and efficient way to manage users and blog posts.
-
User Authentication and Registration:
- Secure user registration and login functionality.
- Password hashing for enhanced security.
-
Post Management:
- Authenticated users can create, edit, and delete their own posts.
- Posts are accessible with author details and creation dates.
-
Authorization:
- Role-based authorization to control access to certain features.
- Only user will see the unpublished posts when authenticated and authorized as the author of them
-
Backend:
- Node.js
- PostgreSQL for storing user information and blog posts.
- GraphQL API for efficient communication with the frontend.
-
Authentication:
- JSON Web Tokens (JWT) for secure user authentication.
-
Clone the repository:
git clone https://github.com/Aimeana100/blogApp-graphql-api.git
-
Install dependencies:
cd blogApp-graphql-api npm install
-
Configure environment variables:
-
Create a .env file in the root of the project and add the following variables:
-
Set up environment variables for PostgreSQL connection, JWT secret, etc.
-
-
Run the application:
npm run dev