An open API service indexing awesome lists of open source software.

https://github.com/niklas-schmidt-dev/shipable-template-starter-node-postgres

A React starter with a Node API boundary, typed browser client, and Postgres schema.
https://github.com/niklas-schmidt-dev/shipable-template-starter-node-postgres

general shipable shipable-template starter-node-postgres

Last synced: 29 days ago
JSON representation

A React starter with a Node API boundary, typed browser client, and Postgres schema.

Awesome Lists containing this project

README

          

# Shipable Node + Postgres Starter

This generated app uses React/Vite/Tailwind for the frontend, a Node HTTP API in `api/`, and Postgres migrations in `db/migrations/`.

## Local Development

Install dependencies:

```bash
npm install
```

Run the frontend:

```bash
npm run dev
```

Run the API in another terminal:

```bash
DATABASE_URL=postgres://user:password@localhost:5432/app npm run dev:api
```

Run the API with the service start command:

```bash
DATABASE_URL=postgres://user:password@localhost:5432/app npm run start
```

`npm run start` runs `npm run build:api` first and then starts the compiled server with Node from `.shipable/service/api/server.js`.

Validate the full project:

```bash
npm run typecheck
npm run check:api
npm run build:api
npm run build
```

The static preview uses clearly marked fallback data when the API is not deployed or `DATABASE_URL` is missing.

Shipable applies SQL migrations from `db/migrations/*.sql` in filename order before starting the service.

The service runtime listens on `PORT` when provided and defaults to `8787`. The health endpoint is `/api/health`.

The Node API sets conservative security headers, no-store JSON responses, generic error bodies, fixed URL parsing that does not trust the Host header, and explicit `405 Method not allowed` responses for known API routes.