Skip to content

Virtuvia Online — World technology news, explained in plain words

Top stories

Balkan Tech

Technology in Serbia, Croatia, Bosnia and Herzegovina and Montenegro: official data, regulation and what global news means locally.

View all

Artificial Intelligence

Models, agents and the ideas behind modern AI — explained for everyone.

View all

Cybersecurity

Protect your accounts, devices and data — without the jargon.

View all

Gaming

Consoles, PC and mobile games, studios and the business behind them — confirmed news, not rumours.

View all

Software

Apps, platforms and the tools people use every day.

View all

Gadgets

Phones, laptops, wearables and the chips inside them.

View all

Robotics

Machines that sense, decide and move in the physical world.

View all

Static preview — code is not executed on our servers.

Dev Zone

Practical code for builders: AI development, Next.js, Python, automation and local AI.

Intermediate

Validate Environment Variables with Zod

Fail fast with a clear message when configuration is missing or malformed — instead of a mysterious crash in production.

Next.jsWeb Development
env.ts Tested
import { z } from "zod";

const EnvSchema = z.object({
  DATABASE_URL: z.url(),
  NODE_ENV: z.enum(["development", "test", "production"]).default("development"),
  PORT: z.coerce.number().int().positive().default(3000),
});

export function loadEnv(source: Record<string, string | undefined> = process.env) {
  const result = EnvSchema.safeParse(source);
  if (!result.success) {
    const problems = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`);
    throw new Error(`Invalid environment variables:\n${problems.join("\n")}`);
  }
  return result.data;
}

Featured tools

AI Tools Directory

Useful AI tools, described plainly — with pricing only when we have verified it.

Browse all tools
  • ChatGPT

    OpenAI

    Check official pricing

    A general-purpose conversational assistant built on OpenAI’s language models.

    Best for: Writing, explaining, brainstorming and everyday questions.

    View tool
  • Claude

    Anthropic

    Check official pricing

    An AI assistant from Anthropic for writing, analysis, coding and working with long documents.

    Best for: Long-document analysis, careful writing and programming help.

    View tool
  • Perplexity

    Perplexity AI

    Check official pricing

    An AI answer engine that searches the web and cites the sources behind its answers.

    Best for: Research questions where you want to see sources.

    View tool
  • Ollama

    Ollama

    Open source

    An open-source tool for downloading and running language models on your own computer.

    Best for: Private, offline AI and local development.

    View tool
  • Check official pricing

    An AI pair programmer that suggests code and answers questions inside your editor.

    Best for: Writing and understanding code faster.

    View tool
  • Gemini

    Google

    Check official pricing

    Google’s AI assistant, with integrations across Google services.

    Best for: Everyday questions and work inside the Google ecosystem.

    View tool

Virtuvia has no affiliate or sponsorship relationship with the tools listed here.