Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .dockerignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.idea/*
.vscode/settings.json
client/build/
server/public
coverage/
db/
dbtest/
Expand Down
27 changes: 0 additions & 27 deletions .npmignore

This file was deleted.

4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ client/package.json
client/package-lock.json
db/*
dbtest/*
package-lock.json
package.json
server/package-lock.json
server/package.json
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ before_install:
- npm i -g npm@5
cache:
directories:
- "node_modules"
- "client/node_modules"
- "server/node_modules"
install:
- scripts/build.sh
script:
- scripts/lint.sh
- npm run test --prefix server
76 changes: 59 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,52 +26,94 @@ Some configuration is exposed via environment variables. See [configItems.js](ht

See [docker-validation](https://github.com/rickbergfalk/sqlpad/tree/master/docker-validation) folder for example docker-compose setup with SQL Server.

## Building

- Clone/download this repo
- Install node 8 or later ([nvm recommended](https://github.com/creationix/nvm))
- Ensure you have the latest npm

```sh
npm install npm -g
```

- Install dependencies and build the UI

```sh
scripts/build.sh
```

At this point you can run the SQLPad server with the frontend built for production use:

```sh
cd server
node server.js --dir ../db --port 3010 --base-url '/sqlpad'
```

If prefered, SQLPad can be installed as a global module using the local files in this repo. This allows running SQLPad via the cli in any directory, just as if you had installed it with `npm install sqlpad -g`

```sh
cd server
node install -g

# Now from somewhere else you can run sqlpad like
cd ~
sqlpad --dir ../db --port 3010 --base-url '/sqlpad'
```

A docker image may be built using the Dockerfile located in `server` directory. See `docker-publish.sh` for example docker build command.

## Development

* Clone/download this repo
* Install node 8 or later ([nvm recommended](https://github.com/creationix/nvm))
* Ensure you have the latest npm
- Clone/download this repo
- Install node 8 or later ([nvm recommended](https://github.com/creationix/nvm))
- Ensure you have the latest npm

```sh
npm install npm -g
```

* Install dependencies (front and back)
- Install dependencies and build the UI

```sh
npm ci --prefix client
npm ci
scripts/build.sh
```

* Build front-end
- Open 2 terminal sessions in the root of this repo.

In one install the backend dependencies and start the development server

```sh
npm run build
npm start --prefix server
```

* Start dev server
In the other install frontend dependencies and start the devleopment server

```sh
npm start
npm start --prefix client
```

At this point you should have both back-end and front-end development servers running.
At this point you should have both backend and frontend development servers running.

http://localhost:3000 serves react front-end in dev-mode
http://localhost:3010 serves front-end compiled for production
http://localhost:3000 serves React-based frontend in dev-mode
http://localhost:3010 serves frontend compiled for production

When viewing the front end in development mode, the page will automatically refresh on front-end file change. The back-end server will always auto-restart on file change.
When viewing the frontend in development mode, the page will automatically refresh on frontend file change. The backend server will auto-restart on backend file change.

### Databases
### Optional step

A docker-compose file with is provided to provide an empty postgres database to test with.
If you have docker installed you can do the following:
If you have docker installed, in a third terminal session you can do the following:

```sh
# Bring database containers up in background
docker-compose up

# control-c will stop the databases in docker compose

# If you would like to run this in the background, run
docker-compose up -d

# To bring database down
# To bring database down from background
docker-compose down

# To remove dangling containers volumes etc
Expand Down
2 changes: 2 additions & 0 deletions client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public
build
File renamed without changes.
2 changes: 2 additions & 0 deletions client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock.json
package.json
Loading