Local Setup
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:
Setup Process
-
Clone the project repository.
-
Install pnpm globally if you don't have it:
npm install -g pnpm
-
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
-
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
andSERVER_DATABASE_URL
are required for the app to work correctly. -
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.
- 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.
- 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.