Giter VIP home page Giter VIP logo

bun-users's Introduction

CRUD REST API using Bun, Elysia, SQLite and TypeScript

CRUD REST API using Bun, Elysia, SQLite and TypeScript ๐Ÿš€. It also includes tests and seeders.

Installation

  1. Run bun i to install all the required dependencies

How to run

Please, follow these steps to ensure the app successfully runs.

  1. Copy the .env.development.example file into the root of the project and name it .env.development. Once you have done this, replace the value for the environment variable DB_FILE_PATH with the path to your SQLite database file. Please note that the path is expected to be relative to the root of the project directory.
  2. Run the following command bun run server to start the API server locally.

There are other commands which could be helpful in the development process:

  • Run bun run server:dev to run the functions locally and watch for file changes (hot reloading).
  • Run bun run test to run all the tests with Bun's test runner and get the current code coverage.

Database

  • Run bun run db:seed to run the seeders and populate your database with initial data.

Project Structure

src

controllers

It has all controllers files that the API needs to handle the communication between the routers and the database. It plays the role of the Elysia.handlers

models

It contains all the necessary methods to communicate with the data source for each model object identity on this project.

tests

All the unit tests for this project are located here.

db/seeders

It has the seeders needed to populate the database with the initial mock data for the project.

bun-users's People

Contributors

brianr482 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.