Skip to main content

Create Project

Creating a New Project

To create a new project and initialize a data store:

platform create-dna-app

Redis Setup

Your project requires Redis server. Follow the installation instructions for your operating system:

Install Redis using Homebrew:

brew install redis

Start Redis server:

brew services start redis

Verify Installation

Test if Redis is running properly:

redis-cli ping

You should receive a PONG response.

Redis Server Command

You can also start Redis using the redis-server command directly:

redis-server

However, note that if you close the terminal where you ran this command, the Redis server will stop. For development purposes, it's recommended to use the service-based commands (like brew services on macOS or systemctl on Linux) as they keep Redis running in the background.

Project Setup Portal

Environment Configuration

  1. After project creation, copy the environment sample file:
cp .env-sample .env

Package Manager Commands

Select your preferred package manager to see all relevant commands:

  1. Install dependencies:
npm install
  1. Start in development mode:
npm run dev

Project Setup Data Store

Environment Configuration

  1. After project creation, copy the environment sample file:
cp .env-sample .env

If .env-sample doesn't exist, create a new .env file in your project root directory.

Package Manager Commands

Select your preferred package manager to see all relevant commands:

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Generate database schemas:
npm run drizzle:generate
  1. Run database migrations:
npm run drizzle:migrate
  1. Start in debug mode:
npm run start:debug
  1. Start in development mode:
npm run start:dev

Portal Structure

After creation, your project will have the following structure:

your-project/
src/
├── app/
│ ├── api/
│ ├── login/
│ └── portal/
├── auto-generated/
│ └── entities/
├── components/
│ ├── application-layout/
│ ├── eslint-config/
│ ├── platform/
│ └── ui/
├── context/
│ └── providers/
├── hooks/
│ └── common/
├── lib/
│ └── utils/
├── server/
│ ├── api/
│ └── auth/
├── styles/
│ └── globals/
├── trpc/
│ └── shared/
└── utils/
└── helpers/

Data Store Structure

src/
├── main.ts
├── main.module.ts
├── providers/
│ ├── files/
│ └── store/
├── schema/
│ ├── application/
│ ├── crdt/
│ └── index.ts
└── xstate/
└── modules/