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.
- Host: GitHub
- URL: https://github.com/leojuriolli7/cluster-api
- Owner: leojuriolli7
- Created: 2022-07-13T19:36:50.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T12:05:42.000Z (almost 3 years ago)
- Last Synced: 2025-02-13T07:34:06.262Z (over 1 year ago)
- Topics: api, atlas, backend, express, forum, graphql, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage: cluster-api.vercel.app
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.