https://github.com/athulsabu2002/nest-js-supabase-jwt-auth
https://github.com/athulsabu2002/nest-js-supabase-jwt-auth
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/athulsabu2002/nest-js-supabase-jwt-auth
- Owner: AthulSabu2002
- Created: 2025-07-09T10:17:22.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-15T15:45:15.000Z (3 months ago)
- Last Synced: 2025-07-16T10:50:57.899Z (3 months ago)
- Language: TypeScript
- Size: 106 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Auth API
A secure authentication API built with NestJS and Supabase.
## Description
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.
## Tech Stack
- [NestJS](https://nestjs.com/) - Backend framework
- [Supabase](https://supabase.io/) - Authentication
- TypeScript - Programming language## Prerequisites
- Node.js (v14 or later)
- npm or yarn
- Supabase account## Environment Variables
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
```## Project setup
```bash
$ npm install
```## Compile and run the project
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```## API Endpoints
### Authentication
- `POST /auth/signup` - Register a new user
- Body: `{ "email": "user@example.com", "password": "password" }`- `POST /auth/signin` - Login existing user
- Body: `{ "email": "user@example.com", "password": "password" }`- `GET /auth/profile` - Get user profile (requires authentication)
- Header: `Authorization: Bearer your_jwt_token`## Authentication
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
```## Run tests
```bash
# unit tests
$ npm run test# e2e tests
$ npm run test:e2e# test coverage
$ npm run test:cov
```## Support
For support, please open an issue in the repository or contact the project maintainers.
## License
This project is [MIT licensed](LICENSE).