Code Monkey home page Code Monkey logo

makers_bookmark_manager_ruby's Introduction

Makers Academy - Week 4 Pair Programming Project

Bookmark Manager Challenge

Outline | Task | Installation Instructions | Domain Model | User Stories | Feature Tests | Objects & Methods |

This week, we're building a web app that stores web bookmarks in a database.

We're going to build a bookmark manager. A bookmark manager is a website to maintain a collection of bookmarks (URLs). You can use it to save a webpage you found useful. You can add tags to the webpages you saved to find them later. You can browse bookmarks other users have added. You can comment on the bookmarks.

Getting started

Clone the repository from github then change directory into it. Run bundle then rackup to initialise the server:

$ git clone [email protected]:BenSheridanEdwards/Bookmark_Manager.git
$ cd Bookmark_Manager
$ bundle

To run your Bookmark Manager app once you've completed the steps below, use:

$ rackup -p 4567

To view your bookmarks, navigate to: localhost:4567/bookmarks after you've ran rackup

To run tests:

$ rspec

To run linting:

$ rubocop

Installing PostgreSQL & Installing your own database.

I'd reccomend using the package manager Homebrew to start the install of PostgreSQL:

$ brew install postgresql

Alternatively, you can download the PostgreSQL app, here.

When you have PostgreSQL installed, you can start it and keep it running in the background with the command:

$ brew services start postgresql

When you're ready to start interacting with your database, you can use PostgreSQl's built-in interface (psql), a command-line tool to start using SQL, PostgreSQL's lanaguage.

To get started with your first database, i'm quickly going to show you how to create your database in the steps below:

$ psql postgres

Typing psql postgres instead of psql DATABASE_NAME will give us the access to create our first database

postgres=# CREATE DATABASE "your_user_name_here"; 

This will usually be the same name as your computer

yourusername=# CREATE DATABASE bookmark_manager;

This will create your bookmark manager database

yourusername=# \c bookmark_manager;

This will connect you to your newly created database

To setup the table structure for your bookmark manager, run psql after you've connected to your new database. Then run the SQL scripts in the db/migrations folder in the given order:

bookmark_manager=# psql

or you can create a new bookmarks table with:

CREATE TABLE bookmarks(id SERIAL PRIMARY KEY, url VARCHAR(60));

You can now inspect your new table:

bookmark_manager=# \dt

To query all the data from your bookmarks table at any time:

SELECT * FROM bookmarks;

You'll find all the commands to create databases and tables, as well as select, add, update, delete your tables, here.

As a user of the bookmark manager,
so I can access websites I go to regularly,
I would like to view all my bookmarks,

As a time-pressed user
So that I can save a website
I would like to add the site's address and title to bookmark manager

As a user
So I can store bookmark data for later retrieval
I want to add a bookmark to Bookmark Manager

Model

makers_bookmark_manager_ruby's People

Contributors

bensheridanedwards avatar samfolo avatar

Watchers

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