Skip to content

update development.md to continue to work#109

Open
gbumanzordev wants to merge 2 commits into
GeorgeSG:masterfrom
gbumanzordev:docs/dev-port-and-data-fixes
Open

update development.md to continue to work#109
gbumanzordev wants to merge 2 commits into
GeorgeSG:masterfrom
gbumanzordev:docs/dev-port-and-data-fixes

Conversation

@gbumanzordev
Copy link
Copy Markdown

When trying to setup the repository I encountered several issues running the specified commands, this is the changes I made to get the app to work properly and the database migrations/seeding working.

  • fix(web): default Vite dev port to 5173 and auto-wire API URL
  • docs: correct dev ports, add data dir step, fix knex typo

Both apps previously defaulted to port 3000 (server PORT, web
VITE_WEB_PORT), causing a collision when running npm run dev.

Default the Vite dev port to 5173 and inject VITE_WEB_API_URL with
http://localhost:${PORT} in development mode so the web app reaches
the backend out of the box. Production behavior is unchanged
(empty base URL, same-origin requests against the server-served
frontend).
- Document actual dev ports (server 3000, web 5173) and the new
  zero-config behavior for VITE_WEB_API_URL.
- Note that the data/ directory must exist before running migrations,
  since better-sqlite3 will not create the parent folder.
- Fix typo in the migrate:rollback command (npm run -w serverknex ->
  npm run -w server knex).
Copilot AI review requested due to automatic review settings April 29, 2026 15:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates local development defaults and documentation so the repo can be set up and run successfully, aligning the web dev server with Vite’s default port and clarifying/repairing the database setup + migration/seed workflow.

Changes:

  • Change the web dev server default port to 5173 and inject a default dev API base URL when not configured.
  • Update DEVELOPMENT.md with corrected ports, a required data/ directory creation step, and a fixed knex command typo.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/web/vite.config.ts Updates default dev port and wires a default VITE_WEB_API_URL for development builds.
DEVELOPMENT.md Fixes/clarifies local dev setup steps (ports, data dir creation, knex command).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/vite.config.ts

return defineConfig({
plugins: [react(), svgr()],
css: { postcss: './postcss.config.cjs' },
Comment thread DEVELOPMENT.md
Comment on lines 287 to +292
# Delete the database
rm data/dev.db

# Make sure the data directory exists
mkdir -p data

Comment thread DEVELOPMENT.md
Comment on lines +141 to +143
- Runs on http://localhost:5173 by default (override with `VITE_WEB_PORT`)
- Hot module replacement enabled
- Talks to the API at `http://localhost:${PORT}` in dev (override with `VITE_WEB_API_URL`)
Comment thread DEVELOPMENT.md
| `PORT` | `3000` | Express server (`apps/server`) |
| `VITE_WEB_PORT` | `5173` | Vite dev server (`apps/web`) |
| `VITE_WEB_HOSTNAME` | `localhost` | Vite dev server bind host |
| `VITE_WEB_API_URL` | `http://localhost:${PORT}` in dev, empty in prod | Web app API base URL |
gbumanzordev added a commit to gbumanzordev/KoInsight that referenced this pull request Apr 29, 2026
chore: bring port + data dir dev fixes from upstream PR GeorgeSG#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants