Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18+ (for server and web)
- pnpm (recommended package manager)
- Docker & Docker Compose (for database)
- Flutter SDK (only if developing mobile app)
- Git
Clone the Repository
Development Setup
Option 1: Full Stack with Docker (Recommended)
The easiest way to get started is using Docker Compose for the entire stack:Start all services
- PostgreSQL database on port 5432
- Server API on port 3001
- Web app on port 3000
Access the application
Open your browser to http://localhost:3000
Option 2: Manual Setup (More Control)
For more control over individual services, you can run them manually:Set up the server
.env file in the server/ directory:Set up the web app
In a new terminal:Create a Start the development server:
.env.local file (optional):The
SERVER_URL is optional. By default, Next.js rewrites /api/* requests to http://127.0.0.1:3001/api/*.Access the application
Open http://localhost:3000 and create your first account!
Mobile Development (Optional)
If you want to develop the mobile app:Verify Installation
To verify everything is working:- Server: Visit http://localhost:3001/api/health
- Web: Visit http://localhost:3000
- Database: Connect with any PostgreSQL client:
- Host:
localhost:5432 - Database:
anchor - User:
anchor - Password:
password
- Host:
Environment Variables
The main environment variables you can configure:| Variable | Description | Default |
|---|---|---|
APP_URL | Base URL for the application | http://localhost:3000 |
JWT_SECRET | Secret for JWT tokens | Auto-generated |
PG_HOST | PostgreSQL host | localhost |
PG_USER | PostgreSQL username | anchor |
PG_PASSWORD | PostgreSQL password | password |
PG_DATABASE | Database name | anchor |
PG_PORT | PostgreSQL port | 5432 |
USER_SIGNUP | Sign up mode: disabled, enabled, or review | (not set) |
.env.example in the repository root for a complete list.
Next Steps
Now that your environment is set up:- Learn about the architecture of Anchor
- Read about building for production
- Check out the contribution guidelines
Troubleshooting
Port already in use
If you see errors about ports being in use:Database connection issues
Ensure the database is healthy:anchor-db-dev container should show as “healthy”.