https://github.com/cedrickchee/painless-pg-node
Painless PostgreSQL Node.js backend with Objection + Knex + Express
https://github.com/cedrickchee/painless-pg-node
api-server expressjs expressjs-boilerplate nodejs-backend objectionjs postgresql
Last synced: 1 day ago
JSON representation
Painless PostgreSQL Node.js backend with Objection + Knex + Express
- Host: GitHub
- URL: https://github.com/cedrickchee/painless-pg-node
- Owner: cedrickchee
- Created: 2020-06-28T11:52:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T16:54:34.000Z (over 2 years ago)
- Last Synced: 2025-05-07T20:39:10.026Z (about 2 months ago)
- Topics: api-server, expressjs, expressjs-boilerplate, nodejs-backend, objectionjs, postgresql
- Language: JavaScript
- Homepage:
- Size: 878 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Painless Node.js API with SQL Database
A minimal scaffold project that shows how to painlessly build a robust API with SQL database on Node.js.
## What's included
- [node-postgres](https://node-postgres.com/) - Node.js modules for interfacing with PostgreSQL database
- [Knex.js](http://knexjs.org) - SQL query builder
- [Objection.js](https://vincit.github.io/objection.js/) - An SQL-friendly ORM built on Knex for Node.js
- [Express.js](https://expressjs.com/) - Web framework for Node.js. A myriad of HTTP utility methods for creating API easily.## What does it do
It provides a simple idea/comment database and shows how relation can be modelled with Objection `Model` class. It also shows how to use eager loading to get related queries.
## Development
- Clone this repo: `git clone https://github.com/cedrickchee/painless-pg-node.git`
- `cd painless-pg-node`
- `npm install` to install required project dependencies.
- Modify database connection according to your machine in `knexfile.js`.
- Run it:
- `npm start` to start the production server.
- `npm run dev` to start the development server.
- Point your browser to `http://localhost:3000/ideas` to test if it's working.