An open API service indexing awesome lists of open source software.

https://github.com/leojuriolli7/cluster-api

GraphQL API for a forum with posts, comments and authentication.
https://github.com/leojuriolli7/cluster-api

api atlas backend express forum graphql mongodb mongoose nodejs

Last synced: 2 months ago
JSON representation

GraphQL API for a forum with posts, comments and authentication.

Awesome Lists containing this project

README

          

# cluster-api

This is a GraphQL API for a forum, I am using it on my other project on the front end, a forum called Cluster.

It uses Nodejs and Express, Mongoose for connecting with Mongodb and JWT for authentication.

The API has been deployed in production to Vercel as a [serverless function](https://vercel.com/docs/concepts/functions/serverless-functions).

## Features:

- User registration, login and authentication with JWT.

- Option to create posts and comment in posts (if logged in).

- Option to edit and delete posts (if logged in and if your user created them).

- Option to edit and delete comments (if logged in and if your user created them).

- Queries for comments and posts along with pagination.

## Usage:

1. Clone the repository:

```bash
git clone git@github.com:leojuriolli7/cluster-api.git
```

2. Download dependencies:

```bash
npm install
```

3. Add your environment variables to .env (Database url, username, password, JWT secret token)

4. Connect your own database, have it ready (will need to alter the `db/index.js` file if not using MongoDB Atlas)

5. Run the project:

```bash
npm run dev
```

6. Access /graphql to test the API and to see the documentation.