This project is a full-stack application that demonstrates how to implement authentication and authorization using Clerk as a third-party service. The backend is built with NestJS, and the frontend is built with React. The project supports both REST API and GraphQL strategies for handling authentication and authorization, and integrates Apollo Client for GraphQL requests.
- User authentication with Clerk.
- Authorization guards for protected routes.
- Support for both HTTP (REST) and GraphQL APIs.
- Frontend built with React, integrated with Clerk for authentication.
- Apollo Client configured for GraphQL requests.
- Node.js and npm installed.
- A Clerk account and application set up.
git clone https://github.com/amiraadev/clerck-auth-nestjs-react.git
cd nestjs-react-auth-clerk
cd backend
npm install
cd ../frontend
npm install
Create a .env file in the Frontend directory and add the following variables:
VITE_CLERK_PUBLISHABLE_KEY=
Create a .env file in the Backend directory and add the following variables:
JWT_PUBLIC_KEY=
This README now correctly emphasizes the usage of guards for protecting routes instead of middleware in your NestJS and React project.