Git Product home page Git Product logo

testing-bun-runtime's Introduction

Simple API for user registration/authentication

Status: Finished

AboutFeaturesAPI RoutesHow it worksTech StackAuthor

About

Testing Elysia with Bun runtime - Is a simple API created to test the new runtime JavaScript/TypeScript: Bun


Features

  • Register user
  • Sign In with user
    • JWT Authentication
  • Get user profile using the JWT

API Routes

  • 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

How it works

Pre-requisites

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

Run the app

# 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 tests

# Run unit tests
$ bun test:unit

Tech Stack

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


Author

  • Artur Poffo - Developer

Linkedin Badge Gmail Badge


testing-bun-runtime's People

Contributors

artur-poffo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.