johnisom / sinatra_todos_database

To-do Ruby Sinatra web app with a Postgres DB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sinatra Todos—Database

Database persistent Sinatra-backed ruby web application for creating, viewing, editing, and deleting to-do lists and their respective to-dos.

This is a todo list manager powered by Sinatra and PostgreSQL. It offers permanent database persistence, multiple todo lists, each with their own todos, and editable todos & todo lists.

GIF screen recording of application in use

Installation

To be able to run this server locally, you must have PostgreSQL installed on your machine. To do this, enter these commands (for Debian-based GNU/Linux users):

$ sudo apt update
$ sudo apt install postgresql postgresql-contrib libpq-dev
$ sudo -u postgres createuser --superuser $USER
# ^^ So you can connect to the server
$ sudo -u postgres createdb $USER
# ^^ To create a defaut database for use with the `psql` command

And optionally, to save your psql history, enter this command:

$ touch ~/.psql_history

Instructions for installing PostgreSQL can be found on Launch School’s installation instructions.

After you have psql set up, follow these instructions:

  1. Clone this repository (git clone https://github.com/johnisom/sinatra_todos_database)
  2. cd into the repository (cd sinatra_todos_database)
  3. Install dependencies (bundle install)
    • If you don’t have ruby-2.6.5, install it
  4. Create the database schema:
$ echo 'create database todos;' | psql
$ psql todos < schema.sql
  1. Run the server locally (bundle exec rackup)
  2. Enjoy your todo app at http://localhost:9292/

About

To-do Ruby Sinatra web app with a Postgres DB


Languages

Language:Ruby 43.7%Language:CSS 36.6%Language:HTML 17.2%Language:JavaScript 2.5%