https://github.com/msalihaltun/elysia-jwt-example
JWT token based authentication API endpoints in Elysia.js, a web framework for Bun.js
https://github.com/msalihaltun/elysia-jwt-example
bun elysia jwt prisma
Last synced: 6 months ago
JSON representation
JWT token based authentication API endpoints in Elysia.js, a web framework for Bun.js
- Host: GitHub
- URL: https://github.com/msalihaltun/elysia-jwt-example
- Owner: msalihaltun
- License: mit
- Created: 2023-09-03T10:54:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T13:09:11.000Z (about 2 years ago)
- Last Synced: 2025-04-13T09:54:34.487Z (6 months ago)
- Topics: bun, elysia, jwt, prisma
- Language: TypeScript
- Homepage:
- Size: 29.3 KB
- Stars: 17
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elysia-jwt-example
A tiny example that implements token based authentication in [bun](https://bun.sh/) and [elysia](https://elysiajs.com/).Inspirations from [this blog post by Mihai-Adrian Andrei](https://dev.to/mihaiandrei97/jwt-authentication-using-prisma-and-express-37nk).
## Try locally
- Install [bun](https://bun.sh/).
- Clone this repository.
- Run `bun i` to install the necessary packages.
- Run `bunx prisma generate` to initialize the sqlite database from the prisma [schema file](prisma/schema.prisma).
- Set environment variables
- `DATABASE_URL` (since I used sqlite this was set to `file:./dev.db`)
- `JWT_ACCESS_SECRET`
- `JWT_REFRESH_SECRET`
- Run `bun run dev` to start the application.