GithubHelp home page GithubHelp logo

cupcake-store's Introduction

cupcake-store Elysia with Node/Bun runtime

This application is built using Docker, Node.js/Bun, ElysiaJS for server-side logic, Prisma for database management, and PostgreSQL as the relational database.

Technologies Used

  • Docker: Simplifies deployment by containerizing the application.
  • Node.js: The runtime environment for executing JavaScript on the server side.
  • ElysiaJS: A fast, minimalist web framework for Node.js applications.
  • Prisma: Serves as the ORM for handling database operations.
  • PostgreSQL: The underlying relational database to store application data.

Getting Started

These instructions will guide you through setting up and running a copy of the project on your local machine for development and testing purposes.

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker and Docker Compose
  • Node.js (for running the project outside of Docker)
  • Bun (optional, for an alternative runtime environment)

Setup and Installation

  1. Clone the Repository

    git clone https://github.com/your-repository/8flow.git
    cd 8flow
  2. Environment Configuration

    Duplicate the .env.example file to .env and update it with your PostgreSQL database credentials and other necessary environment variables.

    DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
    
  3. Build the Docker Containers

    • To run the whole project with Docker, follow the steps below: Use Docker Compose to build the application and database containers:
    docker-compose build

    The app can be run with or without Docker.

    • To run the project without Docker, you can use the bun command-line tool to start the application.
    • to run the DB in docker use the following command:
      • docker run --name dev-postgres -p 5432:5432 -e POSTGRES_PASSWORD=12345678 -d postgres
  4. Start the Application

    Launch your application with Docker Compose:

    docker-compose up

    Your application should now be accessible at http://localhost:8080.

Database Schema

The application uses Prisma to manage database interactions. Here's an example schema for a Cupcake model:

model Cupcake {
    id          Int     @id @default(autoincrement())
    name        String  @db.Text()
    description String  @db.Text()
    price       Float   @db.Real
    ingredients String[]
}

Getting Started

To get started with this template, simply paste this command into your terminal:

bun create elysia ./elysia-example

Development

To Generate the Prisma Client to interact with the db:

npm run generate

To Seed the DB with some data:

npm run seed

To start the development server run:

bun run dev

to run tests:

bun test

Open http://localhost:3000/ with your browser to see the result.

cupcake-store's People

Watchers

John L 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.