jofsky / react-postgres-boilerplate

A boilerplate to start your project by intergrating PostgreSQL with create-react-app through an API made with Node.js/Express.js and node-postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create-react-app with PostgreSQL intergration

Get started

Install dependencies

  • $npm install

Login to the database

  • Create a .env file similar to the .env.example.env or modify the current file
  • Include your PostgreSQL username, password, database and port.

Map the data

  • Modify the App.js file when mapping the data so that it corresponds to the database collumn name

  • {item.<yourCollumnName>}

Configure the PostgreSQL query

  • The query in api.js must correspond to the database table name

  • client.query("SELECT * FROM <yourTableName>", function(err, result) {})

Start your API

Start your Application

About

A boilerplate to start your project by intergrating PostgreSQL with create-react-app through an API made with Node.js/Express.js and node-postgres

License:MIT License


Languages

Language:JavaScript 76.0%Language:HTML 18.3%Language:CSS 5.7%