Prerequisites
Before you begin, ensure you have the following installed:- Node.js >= 18.16.0
- pnpm 9.0.4 (recommended package manager)
- Docker and Docker Compose (for running PostgreSQL)
- Git (for version control)
Installation Steps
1. Fork and Clone the Repository
First, fork the SnailyCAD repository to your GitHub account:- Visit github.com/SnailyCAD/snaily-cadv4
- Click the “Fork” button in the top right
- Clone your fork locally:
2. Install Dependencies
SnailyCAD uses pnpm as its package manager. Install all dependencies with:3. Set Up Environment Variables
Copy the example environment files:.env files in both the API and client directories. You’ll need to configure these files with your local database credentials and other settings.
4. Start the Database
SnailyCAD uses PostgreSQL as its database. Start it using Docker Compose:5. Generate Prisma Client
Generate the Prisma client and run database migrations:6. Start Development Servers
You can now start both the API and client in development mode:- Starts the PostgreSQL database (if not already running)
- Runs all apps and packages in watch mode with Turbo
- Hot-reloads on file changes
7. Access the Application
Once the development servers are running:- Client: http://localhost:3000
- API: http://localhost:8080
- API Documentation (Swagger): http://localhost:8080/api-docs
Common Development Commands
Build Commands
Code Quality
Database Commands
Testing
Troubleshooting
Port Already in Use
If you encounter port conflicts, you can change the ports in your.env files:
- Client:
PORT_CLIENT(default: 3000) - API:
PORT_API(default: 8080) - Database:
DB_PORT(default: 5432)
Database Connection Issues
Ensure Docker is running and the PostgreSQL container is healthy:snaily-cad-postgres with status “Up”.
Prisma Generation Errors
If you encounter Prisma errors, try:Clean Install
If you experience persistent issues, try a clean reinstall:Next Steps
- Learn about the Architecture of SnailyCAD
- Review the Contributing Guidelines
- Join the Discord community for help and discussions