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:
- macOS
- Linux
- Windows
Install Redis using Homebrew:
brew install redis
Start Redis server:
brew services start redis
For Ubuntu/Debian:
sudo apt update
sudo apt install redis-server
Start Redis server:
sudo systemctl start redis-server
For RHEL/CentOS:
sudo yum install redis
sudo systemctl start redis
We recommend using Windows Subsystem for Linux (WSL) or downloading the Redis installer:
-
Using WSL (Recommended):
- Install WSL and Ubuntu from Microsoft Store
- Follow the Linux installation steps above
-
Direct Windows Installation:
- Download Redis for Windows from https://github.com/microsoftarchive/redis/releases
- Run the installer and follow the setup wizard
Verify Installation
Test if Redis is running properly:
redis-cli ping
You should receive a PONG response.
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
- 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:
- npm
- pnpm
- Yarn
- Install dependencies:
npm install
- Start in development mode:
npm run dev
- Install dependencies:
pnpm install
- Start in development mode:
pnpm run dev
- Install dependencies:
yarn install
- Start in development mode:
yarn dev
Project Setup Data Store
Environment Configuration
- 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:
- npm
- pnpm
- Yarn
- Install dependencies:
npm install
- Build the project:
npm run build
- Generate database schemas:
npm run drizzle:generate
- Run database migrations:
npm run drizzle:migrate
- Start in debug mode:
npm run start:debug
- Start in development mode:
npm run start:dev
- Install dependencies:
pnpm install
- Build the project:
pnpm run build
- Generate database schemas:
pnpm run drizzle:generate
- Run database migrations:
pnpm run drizzle:migrate
- Start in debug mode:
pnpm run start:debug
- Start in development mode:
pnpm run start:dev
- Install dependencies:
yarn install
- Build the project:
yarn build
- Generate database schemas:
yarn drizzle:generate
- Run database migrations:
yarn drizzle:migrate
- Start in debug mode:
yarn start:debug
- Start in development mode:
yarn 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/