GithubHelp home page GithubHelp logo

solderq35 / hospital-website Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 455 KB

[Deprecated] CRUD Database Driven Website using NodeJS and SQL backend

Home Page: https://hospital-website.onrender.com/

License: GNU General Public License v3.0

JavaScript 68.67% HTML 3.20% Handlebars 26.55% CSS 1.58%
handlebars nodejs sql

hospital-website's Introduction

Hospital Website

DISCLAIMER

  • This project will be archived as read-only indefinitely as of April 5, 2024. Any existing site deployments listed below may stay up, but future maintenance or fixes are not planned
    • The production deployment I was using on render.com will only load the index page (which doesn't make any database calls), as the Heroku / ClearDB database I was using is no longer available for free, as of December 18, 2023
    • In theory, this project should still work with a locally deployed SQL database or a cloud SQL database (which you may or may not have to pay for). However, future compatibility with newer NodeJS versions (probably needed for most cloud deployments) is not guaranteed; as listed below this was last tested with NodeJS v16.15.1
  • The info given below is otherwise still accurate from an educational standpoint, and there a variety of other database vendors that may offer free or cheap plans (do your own research). If you pick a nonrelational database vendor like MongoDB, the SQL code as written below will need adjustments, as seen here

Site URL (Try it Yourself!)

About

Proof of concept CRUD (Create, Read, Update, Delete) site, with database interaction.

The site is meant to be used by a theoretical hospital. The user is able to insert new entries, update entries, delete entries, search and view existing entries for a variety of hospital-related applications.

Technologies Used:

  • SQL (ClearDB) for database management
  • NodeJS for backend (last tested to work on NodeJS v16.15.1)
  • Express Handlebars used for frontend templating of recurring site features
  • Deployed on render.com

Database Design

Screenshots

Screenshot of Pharmacy page: Overview

Screenshot of Pharmacy Page after Searching for pharmacy named "Kroger": Search

Screenshot of Pharmacy page after filling out the "Add new Pharmacy" form and adding a new Pharmacy "Johnson Pharmacy": Add

Screenshot of Pharmacy page after deleting " Albertsons" pharmacy: Delete

Screenshot of Pharmacy Update Page after clicking on "Update" for pharmacy "Wallgreens&": Update

Screenshot of Pharmacy page after I updated "Wallgreens&" pharmacy to have the name "Wallgreens" instead: Update2

Usage Setup

SQL Database Setup

  • Helpful Video Guide
    • This video isn't 100% matching this project's use case but still a lot there that helps. Refer to the video if instructions below confuse.
  • Make Heroku account and ClearDB account (Even though we deploy on Render.com, we need Heroku for the free ClearDB database add-on).
    • December 18, 2023 edit: The Heroku ClearDB add-on is no longer free; there may be other free relational (SQL) database offerings out there, do your own research
  • Install MySQL Workbench or similar SQL tool, log in to your ClearDB database in MySQL Workbench. Run the file ddqheroku.sql (found in the project root directory here) in MySQL Workbench to initiate the database creation and populate it with sample data.
  • Create dbcon.js file using your ClearDB credentials, with dbdon.js.example file (in root directory) as a template.
  • If you ever need to debug the SQL database, you can try running some of the commands found in the dmq.sql file here.

How to Run Locally

  • Run yarn to install node modules.
  • Run npm start to test the website locally.

How to Deploy

  • Currently deployed on render.com
  • Optional Security Measure: I made a duplicate, private cloned repository that was identical to the public repository. I removed dbcon.js from the public repository, while keeping dbcon.js in the private repository. I deployed from the private repository to prevent my credentials from being leaked, and I made sure that the public repository had dbcon.js listed in the .gitignore.
    • Another approach is to make a local (not remote) Git branch and keep your credentials there.

hospital-website's People

Contributors

imgyeonglee avatar justinwolford avatar knightsamar avatar solderq35 avatar wolfordj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.