Skip to main content

Local Setup

info

While Marblism's online workspace handles all setup automatically, this guide is for those who want to run the project on their local machine.

Prerequisites

Make sure the following tools are installed on your computer before running your project:

Docker Desktop
Version

pnpm Version

Node.js
version

npm Version

Setup Process

  1. Clone the project repository.

  2. Install pnpm globally if you don't have it:

    npm install -g pnpm
  3. Run the initialization command:

    pnpm run init

    This command will:

    • Set up Docker dependencies
    • Install Node modules
    • Sync your CRUD operations and database with Prisma and ZenStack
  4. The .env file is automatically created from the .env.template. The template contains:

    BASE_URL=http://localhost:8099
    SERVER_AUTHENTICATION_SECRET=your-secret
    SERVER_DATABASE_URL=postgres://root:root@localhost:5442/api
    SERVER_OPENAI_API_KEY=

    Note: SERVER_AUTHENTICATION_SECRET and SERVER_DATABASE_URL are required for the app to work correctly.

  5. Start your development server:

    pnpm run dev

Your project should now be running locally.

Updating the data model

After modifying your data model, you need to apply these changes to your API and database.

When using the workspace, a popup will appear automatically as soon as you edit your models in the models.zmodel file. This popup allows you to run both pnpm run crud:sync and pnpm run database:sync commands with a single click, streamlining the process of applying your model changes.

  1. Run the following command to update your API logic:
pnpm run crud:sync

This command will automatically generate and update the necessary API endpoints based on your model changes.

  1. Apply the changes to your actual database by running:
pnpm run database:sync

This command will update your database schema to match your ZenStack schema.