Skip to content

Instantly share code, notes, and snippets.

@carlosblanc0
Last active September 17, 2021 13:54
Show Gist options
  • Save carlosblanc0/bbb12b79dbca784fb04691ea4e63de37 to your computer and use it in GitHub Desktop.
Save carlosblanc0/bbb12b79dbca784fb04691ea4e63de37 to your computer and use it in GitHub Desktop.
Full Stack

-----------------------------------------------------

donatefy

Database Backend DevOps

The idea behind this project is to connect individuals who are looking to get their blood donated. The result is a simple in-browser app that pushes user's entries into a SQL database.

donatefy

YouTube Shorts

Run Locally

Clone the project

  git clone  git@github.com:carlosblanc0/donatefy.git

Go to the project directory

  cd donatefy

Install dependencies

npm install

Spin up the database (I've used ElephantSQL's free tier for demoing purposes)

touch elephantsql.js
var pg = require('pg');

var conString = "INSERT_YOUR_POSTGRES_URL_HERE" //Can be found in the Details page
var client = new pg.Client(conString);
client.connect(function(err) {
  if(err) {
    return console.error('could not connect to postgres', err);
  }
  client.query('SELECT NOW() AS "theTime"', function(err, result) {
    if(err) {
      return console.error('error running query', err);
    }
    console.log(result.rows[0].theTime);

    client.end();
  });
});

Start the server

  npm start

Design

Figma

Live Demo

Coming soon on https://donatefy.herokuapp.com

Official Repo

tags: Netlify, Templating, Basics

-----------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment