Skip to content

zetz-io/interview

Repository files navigation

Zetz – Full-Stack Interview Project

This repository contains a full-stack Node.js application running with PostgreSQL and Redis, designed to be executed entirely in the browser using GitHub Codespaces.

The environment is fully containerized and requires no local setup.

🚀 Run in Browser (Recommended)

Open this repository on GitHub

Click Code → Codespaces → Create codespace

The application, database, and cache are started automatically

🛠 Setup (inside Codespaces)

Install dependencies:

yarn

Run database migrations:

yarn run migrate -- init.sql yarn run migrate -- seed.sql

(Optional) Install curl for API testing:

apk add --no-cache curl

🗄 Database Access

PostgreSQL is available at:

Host: localhost

Port: 5432

Database: zetz

User: zetz

Password: zetz!

You may connect using psql, a database client, or the VS Code PostgreSQL extension or just do it in code itself using the pg-client.

🔌 API Get product by ID GET /products/:id

Example:

curl http://localhost:5000/products/1

This endpoint:

Reads from PostgreSQL

Uses Redis for read-through caching

Returns cached responses on subsequent requests

⚠️ Port Behavior

The application starts automatically in Codespaces and binds to port 5000.

If you attempt to start the server manually, you may see a port-in-use error.

To stop the running process:

apk add --no-cache iproute2 >/dev/null 2>&1 || true ss -ltnp | grep ':5000' kill

Alternatively, run the application on a different port:

change the port on index.ts and then run yarn dev

🧠 Design Notes

PostgreSQL is used as the primary data store

Redis is used for read-through caching

Database migrations are executed explicitly via SQL files

The development environment is fully reproducible via GitHub Codespaces

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published