Coder Social home page Coder Social logo

book-tracker's Introduction

Book Collection App

The purpose of this app is to track and store a record of books you have read.

  • Use the main books page to view all of your books, add new books to your collection, delete books from your collection, and mark and unmark favorites.
  • Use the genres page to add and manage genres.
  • Use the favorites page to view all of your favorites. You can also unmark favorites or delete books from your collection here.

Get Set Up

Use the following commands to set up your database for the app:

create database

CREATE DATABASE "book_collection";

create "genres" table

CREATE TABLE "genres" (
	"id" SERIAL PRIMARY KEY,
	"genre_name" VARCHAR(150) UNIQUE NOT NULL
);

create "books" table referencing "genre" table

	"id" SERIAL PRIMARY KEY,
	"title" VARCHAR(250),
	"author" VARCHAR(150),
	"image_url" TEXT,
	"publication_date" INT DEFAULT 2018,
	"number_of_pages" INT DEFAULT 1,
	"favorite" BOOLEAN DEFAULT FALSE,
	"genre_id" INT REFERENCES "genres"
);

Need some dummy data to get started?

Add this to your database:

("genre_name")
VALUES ('fiction'), ('mystery'), ('history'), ('biography');
INSERT INTO "books" ("title", "author", "genre_id", "image_url")
VALUES
('Harry Potter and the Order of the Phoenix', 'J.K. Rowling', 1, 'https://images-na.ssl-images-amazon.com/images/I/51lFAzVQUxL._SX342_BO1,204,203,200_.jpg'),
('The Boys in the Boat', 'Daniel James Brown', 3, 'http://www.danieljamesbrown.com/images/TheBoysintheBoat.png'),
('The Secret Place', 'Tana French', 2, 'https://images.gr-assets.com/books/1396671263l/20821043.jpg');

book-tracker's People

Contributors

bjpennington avatar

Watchers

James Cloos 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.