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

https://github.com/fsojitra/getting-started-with-postgresql-and-node

PostgreSQL and Node example with CRUD example
https://github.com/fsojitra/getting-started-with-postgresql-and-node

crud crud-application crud-operations ejs ejs-express express-js expressjs hacktoberfest hactoberfest2020 hactoberfesttru help-wanted node-js nodejs pg postgres postgresql postgresql-database postgressql psql query

Last synced: 7 days ago
JSON representation

PostgreSQL and Node example with CRUD example

Awesome Lists containing this project

README

        

# Getting Started with PostgreSQL and Node
> An PostgreSQL + Node/Express + EJS example you can add, update and delete user data.

## Prerequisites
Below listed things you need to have in your system to run this code

```
- Node.js & NPM
- PostgreSQL
```

## To Setup
* Clone or download this repository

* OK, so i am assuming that you already have prerequisites mentioned above and also know how to use psql from command line :thinking:, if you are new and don't know much about PostgreSQL than follow link below. If you don't like command line that much than you can totally use pgAdmin.

* [PSQL - Commands](https://www.postgresqltutorial.com/psql-commands/)
* [To download and install PostgreSQL and pgAdmin](https://www.guru99.com/download-install-postgresql.html)

* Creting Database

```
CREATE DATABASE userdb;
```

* Now that db is created follw below steps to setup

1. `cd Getting-Started-with-PostgreSQL-and-Node`
2. `npm install`
3. `node db/db_setup.js` (this will setup basic table and add some dummy data to start with)
4. `npm start`

![And, it's Done](https://media.giphy.com/media/3oKIPf3C7HqqYBVcCk/giphy.gif)
### And it's running on
http://localhost:3000

:sparkles: