A secure authentication API built with NestJS and Supabase.
Auth API is a RESTful service that provides robust user authentication capabilities. The project uses NestJS as the backend framework and Supabase for authentication services.
- Node.js (v14 or later)
- npm or yarn
- Supabase account
Create a .env file in the root directory with the following variables:
PORT=3000
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
$ npm install# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod-
POST /auth/signup- Register a new user- Body:
{ "email": "user@example.com", "password": "password" }
- Body:
-
POST /auth/signin- Login existing user- Body:
{ "email": "user@example.com", "password": "password" }
- Body:
-
GET /auth/profile- Get user profile (requires authentication)- Header:
Authorization: Bearer your_jwt_token
- Header:
The API uses Supabase Authentication with JWT tokens. To access protected endpoints, include the JWT token in the Authorization header:
Authorization: Bearer your_jwt_token
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:covFor support, please open an issue in the repository or contact the project maintainers.
This project is MIT licensed.