14a32bdc0d
- Unified monorepo with backend (Express), frontend (Next.js), and devops - Backend: ESLint, Prettier, Jest tests (3 passing), health endpoint, .env.example - Frontend: Fixed build errors, fixed all lint errors (0 remaining), tests passing - DevOps: Docker Compose with PostgreSQL, backend, frontend + healthchecks - CI/CD: 3 GitHub Actions workflows (backend, frontend, docker integration) - DX: Husky pre-commit hooks with smart change detection - Docs: Root README with architecture, CONTRIBUTING.md, PR template Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
67 lines
1.8 KiB
Nix
67 lines
1.8 KiB
Nix
{ pkgs, ... }: {
|
|
packages = with pkgs; [
|
|
# Node.js and package managers
|
|
nodejs_20
|
|
yarn
|
|
nodePackages.typescript
|
|
nodePackages.typescript-language-server
|
|
|
|
# Database
|
|
postgresql_15
|
|
|
|
# Development tools
|
|
git
|
|
curl
|
|
jq
|
|
|
|
# Optional: Add Docker if you want to manage Docker services
|
|
# docker
|
|
# docker-compose
|
|
];
|
|
|
|
# PostgreSQL service for local development
|
|
services.postgres = {
|
|
enable = true;
|
|
package = pkgs.postgresql_15;
|
|
initialDatabases = [{ name = "website_monitoring"; }];
|
|
initialScript = ''
|
|
CREATE USER website_monitoring WITH PASSWORD 'password';
|
|
GRANT ALL PRIVILEGES ON DATABASE website_monitoring TO website_monitoring;
|
|
'';
|
|
};
|
|
|
|
# Optional: Add Redis if needed for caching/sessions
|
|
# services.redis.enable = true;
|
|
|
|
# Environment variables
|
|
env.POSTGRES_DB = "website_monitoring";
|
|
env.POSTGRES_USER = "website_monitoring";
|
|
env.POSTGRES_PASSWORD = "password";
|
|
env.DATABASE_URL = "postgresql://website_monitoring:password@localhost:5432/website_monitoring";
|
|
|
|
# Scripts that run when entering the environment
|
|
enterShell = ''
|
|
echo "🚀 Website Monitoring Frontend Development Environment"
|
|
echo "📦 Node.js $(node --version)"
|
|
echo "🐘 PostgreSQL $(psql --version)"
|
|
echo ""
|
|
echo "Available commands:"
|
|
echo " npm run dev - Start development server"
|
|
echo " npm run build - Build for production"
|
|
echo " npm run lint - Run ESLint"
|
|
echo " psql - Connect to PostgreSQL"
|
|
echo ""
|
|
echo "Database connection:"
|
|
echo " Host: localhost"
|
|
echo " Port: 5432"
|
|
echo " Database: website_monitoring"
|
|
echo " User: website_monitoring"
|
|
echo " Password: password"
|
|
echo ""
|
|
'';
|
|
|
|
# Pre-commit hooks (optional)
|
|
# pre-commit.hooks.shellcheck.enable = true;
|
|
# pre-commit.hooks.nixpkgs-fmt.enable = true;
|
|
}
|