About • Features • API Routes • How it works • Tech Stack • Author
Testing Elysia with Bun runtime - Is a simple API created to test the new runtime JavaScript/TypeScript: Bun
- Register user
- Sign In with user
- JWT Authentication
- Get user profile using the JWT
- Users
- POST /users/signup - Register a new user
- POST /users/signin - Sign in with user and generate JWT
- PATCH /users/profile - Get logged user profile
Before you begin, you will need to have the following tools installed on your machine: Git, Bun runtime. In addition, it is good to have an editor to work with the code like VSCode and a REST client like Insomnia
You will also need to have Docker installed to run the postgres database with Docker Compose
it is very important that before running the project you configure the environment variables as indicated in the file: .env.example
# Clone this repository
$ git clone https://github.com/Artur-Poffo/Testing-Bun-Runtime.git
# Access the project folder cmd/terminal
$ cd Testing-Bun-Runtime
# install the dependencies
$ bun install
# Inicialize the database
# In the root directory after installing docker run:
$ docker compose up
# This command should create and start a container with Postgres database
# Then when you want to stop running docker run:
$ docker compose stop
# Or just press Ctrl+c
# When you want to restart, run:
$ docker compose start
# With your database running and connected in .env file:
$ bunx prisma migrate dev
# Run the application in development mode
$ bun dev
# The server will start at port: 3000 - You can now test in Insomnia or another REST client: http://localhost:3000
# Run unit tests
$ bun test:unit
The following tools were used in the construction of the project:
- Bun runtime/toolkit
- TypeScript
- Elysia Framework
- zod
- Prisma ORM
- @Elysia/jwt
- @Elysia/cookie
- @Elysia/swagger
See the file package.json
- Artur Poffo - Developer