Giter Club home page Giter Club logo

beth-stack's Introduction

beth-stack

This project utilizes a stack comprising several technologies for web development.

Technologies Used:

  1. Bun:

    • Bun is an all-in-one JavaScript runtime providing server-side and client-side development features.
  2. ElysiaJS:

    • ElysiaJS is a server-side JavaScript framework designed for building web applications.
  3. Turso:

    • Turso is a command-line interface (CLI) tool for interacting with databases.
  4. htmx:

    • htmx is a JavaScript library facilitating server-client interactions without requiring a full page reload.

Some Scripts:

  • install: Install some packages.
bun install
  • start: Run your project.
bun run start
  • dev: Run your project in watch mode, which automatically restarts on file changes.
bun run dev
  • db:push: Push your SQLite database schema using drizzle-kit.
bun run db:push
  • db:studio: Open the Drizzle Kit Studio for database management.
bun run db:studio

Create A Table and Insert Data as Initialization

Before use database on client, we need to set up the initial table structure and populate it with sample data, you can use the Turso CLI. Follow these steps:

  1. Open the Turso CLI and connect to your database. Replace "database-name" with the actual name of your database.

    turso db shell "database-name"
    
  2. Inside the Turso CLI, run the following SQL commands to create a table named "todos" with the specified columns:

    CREATE TABLE IF NOT EXISTS todos (
       id INTEGER PRIMARY KEY AUTOINCREMENT,
       content TEXT NOT NULL,
       completed INTEGER NOT NULL DEFAULT 0
    );
    
  3. After creating the table, insert sample data into the "todos" table. This example inserts a todo with the content "Sample Todo Content" and completion status set to 0 (assuming 0 represents false for boolean values):

    INSERT INTO todos (content, completed) VALUES ('Sample Todo Content', 0);
    

By following these steps, you initialize your database with a "todos" table and insert an initial todo for testing purposes.

This project was created using bun init in bun v1.0.23. Bun is a fast all-in-one JavaScript runtime.

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.