Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/dharejo-junaid/graphql-auth

This repo contains full authentication system implemented using graphql in backend. It seamlessly integrates user authentication features within a GraphQL API, providing a secure foundation for your web applications. This project is also dockerized.
https://github.com/dharejo-junaid/graphql-auth

apollo-server docker expressjs graphql graphql-api jsonwebtoken mongoose nodejs

Last synced: about 1 month ago
JSON representation

This repo contains full authentication system implemented using graphql in backend. It seamlessly integrates user authentication features within a GraphQL API, providing a secure foundation for your web applications. This project is also dockerized.

Awesome Lists containing this project

README

        


GraphQL Logo

# graphql-auth
This repo contains full authentication system implemented using graphql in backend. It seamlessly integrates user authentication features within a GraphQL API, providing a secure foundation for your web applications.

## Getting Started

### Prerequisites

- Node.js and npm installed on your system
- MongoDB installed locally or a cloud-based MongoDB service

### Installation

1. Clone the repository to your local machine:

```bash
git clone https://github.com/Dharejo-Junaid/graphql-auth
```

2. Install dependencies using npm:

```bash
npm install
```

3. create a ".env" file:
- PORT=5000
- JWT_SECRET="xxxxxxxxxxx"
- MONGO_URI="mongodb://localhost:27017/auth"
- EMAIL="[email protected]" (required)
- EMAIL_PASS="xxxxxxxxxxxxxxxxxxxxxxx" (required)

4. Start server on port 5000 using:

```bash
npm start
```

5. open your browser and type:
```bash
http://localhost:5000/graphql
```

## API Endpoints
### Queries:
1. login
2. users (This is protected. To access this you need to create an account and verify it);
3. user (This is protected as well. So same goes for this);

## Mutations:
1. Signup
2. Verify