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