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.
- Node.js and npm installed on your system
- MongoDB installed locally or a cloud-based MongoDB service
- Clone the repository to your local machine:
git clone https://github.com/Dharejo-Junaid/graphql-auth
- Install dependencies using npm:
npm install
- create a ".env" file:
- PORT=5000
- JWT_SECRET="xxxxxxxxxxx"
- MONGO_URI="mongodb://localhost:27017/auth"
- EMAIL="xxxxxxxxxx@gmail.com" (required)
- EMAIL_PASS="xxxxxxxxxxxxxxxxxxxxxxx" (required)
- Start server on port 5000 using:
npm start
- open your browser and type:
http://localhost:5000/graphql
- login
- users (This is protected. To access this you need to create an account and verify it);
- user (This is protected as well. So same goes for this);
- Signup
- Verify