Files
goodgo-platform/docs/dev-environment.md
Ho Ngoc Hai 83d55de65b feat: add ESLint flat config, Prettier, dependency-cruiser, and Husky
Setup code quality tooling for the monorepo:
- ESLint 9 flat config with TypeScript, import ordering, and NestJS rules
- Prettier with consistent formatting across all files
- dependency-cruiser enforcing module boundary rules (no cross-module internals, no circular deps)
- Husky + lint-staged for pre-commit hooks
- Auto-fixed existing files for type imports and import ordering

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-07 23:57:28 +07:00

87 lines
1.9 KiB
Markdown

# Development Environment
## Prerequisites
- Docker Engine 24+ & Docker Compose v2
- Node.js 22 LTS (for running app services locally)
## Quick Start
```bash
# 1. Copy environment variables
cp .env.example .env
# 2. Start all infrastructure services
docker compose up -d
# 3. Verify all services are healthy
docker compose ps
```
## Services
| Service | Port(s) | Description | Dashboard/UI |
| ---------- | ----------- | ---------------------------- | ------------------------------- |
| PostgreSQL | 5432 | Database with PostGIS | — |
| Redis | 6379 | Cache, sessions, queue | — |
| Typesense | 8108 | Full-text search engine | http://localhost:8108/health |
| MinIO | 9000 / 9001 | S3-compatible object storage | http://localhost:9001 (console) |
## Common Commands
```bash
# Start services
docker compose up -d
# View logs (all or specific service)
docker compose logs -f
docker compose logs -f postgres
# Stop services (data preserved in volumes)
docker compose down
# Stop and remove all data
docker compose down -v
# Restart a single service
docker compose restart redis
# Check service health
docker compose ps
```
## Connecting to Services
### PostgreSQL
```bash
# Via psql
psql postgresql://goodgo:goodgo_secret@localhost:5432/goodgo
# Verify PostGIS
psql postgresql://goodgo:goodgo_secret@localhost:5432/goodgo -c "SELECT PostGIS_Version();"
```
### Redis
```bash
redis-cli -p 6379 ping
```
### Typesense
```bash
curl http://localhost:8108/health
```
### MinIO
- API: `http://localhost:9000`
- Console: `http://localhost:9001` (login: minioadmin / minioadmin_secret)
## Troubleshooting
- **Port conflict**: Change ports in `.env` (e.g., `DB_PORT=5433`)
- **Permission issues**: Run `docker compose down -v` and restart
- **PostGIS not available**: Ensure using `postgis/postgis:16-3.4` image