Giter VIP home page Giter VIP logo

dbest-stack's Introduction

DBEST stack

DBEST stack

The DBEST stack is a bun-based ๐Ÿ”ฅ BLAZINGLY FAST ๐Ÿ”ฅ full-stack 100% type-safe web development solution that provides everything you need to build a production-ready web app based on the performant and scalable SolidStart meta-framework. It consists of:

Creating a project

Create a new project

bun create itsyoboieltr/dbest-stack

Optionally specify a name for the destination folder. If no destination is specified, the name dbest-stack will be used.

bun create itsyoboieltr/dbest-stack my-app

Bun will perform the following steps:

  • Download the template
  • Copy all template files into the destination folder
  • Install dependencies with bun i.
  • Initialize a fresh Git repo. Opt out with the --no-git flag.

Getting started

Once the project is created and the dependencies are installed, the environment variables need to be set up. The following environment variables can be configured:

.env.example

DATABASE_URL="postgresql://postgres:xxxx@database:5432/dbest"
VITE_HOST_URL="http://localhost:3000"
COMPOSE_APP_PORT="3000"
COMPOSE_DATABASE_PORT="5432"
COMPOSE_DATABASE_USER="postgres"
COMPOSE_DATABASE_PASSWORD="xxxx"
COMPOSE_DATABASE_NAME="dbest"
COMPOSE_DATABASE_BACKUP_PATH="$HOME/backup"
COMPOSE_PROFILES="development"

It is recommended to use a .env file to configure the environment variables.

  • For local development .env.local should be used, as this is ignored by docker compose.
  • For production deployment .env should be used, as this is used by docker compose.

The most important thing to configure is the database connection, as running the app without a database connection will result in an instant error.

In case your database schema does not match the schema defined by drizzle, then the database needs to be synchronized. This can be done by running the following command:

bun push

In addition, drizzle studio can be used to connect to the database and browse, add, delete and update data based on the declared drizzle schema.

bun studio

Developing

If everything is set up correctly, you can start the development server with:

bun dev

Building

Build for production by running the following command:

bun run build

Running

Run in production by running the following command:

bun start

Deployment

Using the Dockerfile or the compose.yaml file, the application can be deployed to any docker host. The following command will build the docker image and start the application.

docker compose up

Important notes for production use:

  1. In a production setting, you might want to enable backups for the database. This can be done by setting the COMPOSE_PROFILES environment variable to production.
COMPOSE_PROFILES="production"
  1. The COMPOSE_DATABASE_BACKUP_PATH environment variable can be used to customize the path where the database backups are stored.
COMPOSE_DATABASE_BACKUP_PATH="$HOME/backup"

dbest-stack's People

Contributors

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