Code Monkey home page Code Monkey logo

nyke's Introduction

Nyke Stack

This stack is a boilerplate for a simple and fast API REST server with based routing guards. Utilizing Bun for speed and efficiency and powering the database ORM and migrations is Drizzle.

  • Bun
  • Typescript
  • Express
  • File Based Router
  • Drizzle ORM w/ Migrations
  • Guarded routes

Dev Setup

To get it going, install packages with bun. Other package managers probably work just fine too.

bun install

Run dev server.

bun dev

Database

We are fans of Planetscale and MySQL, but Drizzle also supports Postgres and SQL Lite. We are just big fans of SQL overall, so anything SQL is good with us. Currently the default config for this boilerplate uses mysql2 and is configured to work with mysql tables. Take a look at Drizzle ORM docs to configure using Postgres if you prefer.

Connecting

Create an .env file

DATABASE_URL=mysql://user:password@localhost:3306/database

Schema

The database schema is managed in the ./schema.ts file. The schema docs here https://orm.drizzle.team/docs/schemas are really great.

Migrations

To migrate the schema changes you will want to generate a new migration by running:

bun generate

This will generate a new file in the ./drizzle/ folder, then will manage the migrations are they are deployed.

Routing

The routing is handled by https://github.com/Danilqa/node-file-router

The route files are in /api

Guards

Simple routing based guards are managed directly in the server.ts. Mostly for transparency and simplicty.

nyke's People

Contributors

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