69 lines
2.0 KiB
Markdown
Raw Normal View History

2025-08-27 20:01:46 +09:00
# Quick Reference: Development & Production
2025-08-21 15:24:40 +09:00
2025-08-27 20:01:46 +09:00
*For detailed setup instructions, see `GETTING_STARTED.md`*
2025-08-21 15:24:40 +09:00
2025-08-27 20:01:46 +09:00
## Development Commands
2025-08-22 17:02:49 +09:00
2025-08-21 15:24:40 +09:00
```bash
2025-08-27 20:01:46 +09:00
# Initial setup
cp .env.dev.example .env && pnpm install
2025-08-21 15:24:40 +09:00
2025-08-27 20:01:46 +09:00
# Daily development
pnpm dev:start # Start services (PostgreSQL + Redis)
pnpm dev # Start apps with hot reload
2025-08-21 15:24:40 +09:00
2025-08-28 16:57:57 +09:00
# Database management
2025-08-27 20:01:46 +09:00
pnpm dev:migrate # Run database migrations
2025-08-28 16:57:57 +09:00
pnpm db:studio # Open Prisma Studio (database GUI)
2025-08-27 20:01:46 +09:00
pnpm dev:tools # Admin tools (Adminer + Redis Commander)
2025-08-22 17:02:49 +09:00
2025-08-28 16:57:57 +09:00
# Service management
2025-08-27 20:01:46 +09:00
pnpm dev:status # Check service status
pnpm dev:logs # View service logs
2025-08-28 16:57:57 +09:00
pnpm dev:restart # Restart services
2025-08-27 20:01:46 +09:00
pnpm dev:stop # Stop all services
2025-08-28 16:57:57 +09:00
pnpm dev:reset # Reset development environment
# Code quality
pnpm lint # Run linting across all packages
pnpm type-check # Run TypeScript checks
pnpm format # Format code with Prettier
2025-08-21 15:24:40 +09:00
```
2025-08-27 20:01:46 +09:00
## Default Ports
- **Frontend**: http://localhost:3000 (configurable via `NEXT_PORT`)
- **Backend**: http://localhost:4000 (configurable via `BFF_PORT` or `PORT`)
- **Adminer**: http://localhost:8080 (when using `pnpm dev:tools`)
- **Redis Commander**: http://localhost:8081 (when using `pnpm dev:tools`)
2025-08-22 17:02:49 +09:00
2025-08-27 20:01:46 +09:00
## Production Commands
2025-08-21 15:24:40 +09:00
2025-08-27 20:01:46 +09:00
*For detailed deployment guide, see `DEPLOY.md`*
2025-08-22 17:02:49 +09:00
2025-08-21 15:24:40 +09:00
```bash
2025-08-27 20:01:46 +09:00
# Setup
cp .env.production.example .env # Edit with production values
2025-08-21 15:24:40 +09:00
2025-08-27 20:01:46 +09:00
# Deploy
pnpm prod:deploy # Build + start + migrate
2025-08-22 17:02:49 +09:00
2025-08-27 20:01:46 +09:00
# Management
pnpm prod:status # Check service status
pnpm prod:logs # View service logs
pnpm prod:update # Update deployment
2025-08-28 16:57:57 +09:00
pnpm prod:restart # Restart services
2025-08-27 20:01:46 +09:00
pnpm prod:stop # Stop services
2025-08-28 16:57:57 +09:00
pnpm prod:backup # Backup data
pnpm prod:cleanup # Clean up old resources
2025-08-21 15:24:40 +09:00
```
2025-08-27 20:01:46 +09:00
## Production Endpoints
- **Portal**: https://yourdomain.com
- **API**: https://yourdomain.com/api
- **Health**: https://yourdomain.com/healthz
2025-08-22 17:02:49 +09:00
2025-08-27 20:01:46 +09:00
## Security Notes
- Nginx enforces HTTPS, HSTS, CSP and rate limiting
- Backend disables `x-powered-by`, supports `trust proxy`
- Never commit `.env` file - keep secrets secure