Prerequisites
Before starting, ensure you have the following installed:- Node.js 24 or later
- pnpm 10.18.3 or later (package manager)
- Docker and Docker Compose (for local PostgreSQL)
- PostgreSQL 17 (can be run via Docker)
Vitaes uses pnpm as the package manager. The project is configured with
packageManager: "[email protected]" in package.json.Installation
Install dependencies
Install all dependencies using pnpm:This will install dependencies for all packages in the monorepo, including:
- Web application (React + TanStack Router)
- Server application (Hono + oRPC)
- Shared packages (auth, api, db)
Set up environment variables
Create environment files for both the server and web applications.Server environment (Web environment (
apps/server/.env):apps/web/.env):Start PostgreSQL database
Use Docker Compose to start a local PostgreSQL instance:This runs the Docker Compose configuration from
packages/db/docker-compose.yml:The database will be available at
postgresql://postgres:password@localhost:5432/vitaesPush database schema
Apply the database schema using Drizzle:This creates all necessary tables including:
- Authentication tables (user, session, account, verification)
- Application tables (resume)
Verify Installation
After completing the setup:- Web Application: Open http://localhost:3001
- API Server: Available at http://localhost:3000
- Database Studio: Run
pnpm db:studioto open Drizzle Studio
Available Development Scripts
The following scripts are available in the rootpackage.json:
| Script | Description |
|---|---|
pnpm dev | Start all applications in development mode |
pnpm build | Build all applications for production |
pnpm check-types | Check TypeScript types across all packages |
pnpm dev:web | Start only the web application |
pnpm dev:server | Start only the server application |
pnpm db:push | Push schema changes to database |
pnpm db:studio | Open Drizzle Studio (database UI) |
pnpm db:generate | Generate database migrations |
pnpm db:migrate | Run database migrations |
pnpm db:start | Start PostgreSQL with Docker Compose |
pnpm db:stop | Stop PostgreSQL container |
pnpm db:down | Stop and remove PostgreSQL container |
Troubleshooting
Database Connection Issues
If you encounter database connection errors:- Verify PostgreSQL is running:
docker ps - Check the
DATABASE_URLinapps/server/.env - Ensure the database exists:
pnpm db:start
Port Already in Use
If ports 3000 or 3001 are already in use:- Stop the conflicting process
- Or modify the ports in:
apps/web/package.json(web port in dev script)apps/server/src/index.ts(server port configuration)
Type Errors
Run type checking across all packages:Next Steps
Now that your development environment is set up:- Learn about the Architecture of the monorepo
- Understand the Database schema and ORM usage
- Review Deployment options for production