Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilyjspencer/the_book_lounge
ππ« Keep a record of your books with this full-stack Sinatra-based application
https://github.com/emilyjspencer/the_book_lounge
capybara databases rspec ruby sinatra sql
Last synced: 9 days ago
JSON representation
ππ« Keep a record of your books with this full-stack Sinatra-based application
- Host: GitHub
- URL: https://github.com/emilyjspencer/the_book_lounge
- Owner: emilyjspencer
- Created: 2020-02-14T22:48:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T18:38:30.000Z (almost 2 years ago)
- Last Synced: 2023-03-04T13:14:44.254Z (over 1 year ago)
- Topics: capybara, databases, rspec, ruby, sinatra, sql
- Language: Ruby
- Homepage:
- Size: 4.67 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Book Lounge
The Book Lounge allow users to sign up for an account, search for books in
the database, and add books to the database.###Β User Stories
```
Sign-up/login/logoutAs a non-registered user,
So I can start to use The Book Lounge,
I'd like to see a sign-up button on the homepageAs a non-registered user,
So I can start to use The Book Lounge
I'd like to sign up using my full name, email, phone number and password
As a newly registered user,
So I know I have successfully signed up,
I'd like to see a "Sign up has been successful"As a registered user
So that only I can post to my account
I'd like to be able to log in using my credentialsAs a registered user
So as to prevent others from accessing my account
I'd like to be able to log outGeneral
As a registered user,
So I can search for books
I'd like to be able to enter a book title and an author into a text fieldAs a registered user,
So I can see if the book I searched for is available,
I'd like to be told if the book is available or noteAs a registered user,
So I can add books
I'd like to be able to add a book with its author, isbn and genreAs a registered user,
So I can see all of the books that are available,
I'd like to see a list of books when I click on 'view all books'
```### Database creation.
The Book Lounge uses **PostgreSQL**, so if you don't have it installed on your computer, please do the following:
Install postgres:
**brew install postgresql**
Start postgres:
**brew services start postgresql**
**psql postgres**
**Create database:**
```html
CREATE DATABASE the_book_lounge;
```**Create a test database:**
```html
CREATE DATABASE the_book_lounge_test;
```### Connect to the_book_lounge database by typing:
**\c**
**Create the following tables, by typing the following SQL commands:**
```html
**CREATE TABLE the_book_lounge(id SERIAL PRIMARY KEY, title VARCHAR(60), author VARCHAR(60), genre VARCHAR(60), isbn VARCHAR(60));**
``````html
**CREATE TABLE users(id SERIAL PRIMARY KEY, name VARCHAR(40), email VARCHAR(60), password VARCHAR(20), phone_number VARCHAR(10));**
``````html
**ALTER TABLE users ALTER COLUMN phone_number TYPE varchar(15);**
```**Check that the tables have been created by typing the following:**
```html
**\dt**
```### How to use:
**Clone this repository:**
**git clone https://github.com/emilyjspencer/The_Book_Lounge.git**
**cd into the repo**
Run **bundle install**
Start the server:
**rackup**
**Go to localhost:9292**
### How to run the tests
**Enter:
```html
rspec
```## Built with
* Ruby
* Sinatra
* HTML/CSS
* SQL## Tested with
* RSpec
* Capybara### What it looks like:
![home2](home2.png)
![home](signup.png)
![home](logout.png)
![home](viewbooks.png)
![home](booksadded.png)