/minimalistTabTracker

A simple node application project to keep track of tabs just like in cafés, bistro, etc.

Primary LanguageJavaScript

minimalistTabTracker

A small node project to keep track of tabs like in cafés, bistro, etc.

Note

This project is still in progress, some features may be missing or unstable.

This project aims to:

  1. Showcase a minimal full-stack capability: front-end, middleware, and database.
  2. Showcase CRUD database operations from a web application.

💡 To get the app running:

  1. Make sure you have Node.js installed
  2. Open a terminal in the cloned repo
  3. type npm install, this will install all dependncies
  4. Once done, type npm start. This runs the application
  5. Either click on the link in the terminal OR go to 'http://localhost:4000' on your browser
  6. You are now using minmalistTabTracker!

⚒️ Node package dependencies:

💽 Database: SQLite

With SQLite, it is possible to setup a portable (serverless) relational database. This makes it easier to showcase the project as no additional setup/connection is required. While still allowing the ability to show how the database is setup and how queries are handled.

  • SQLite database location: src/db/mySQLiteDB.db
  • To see database setup in detail, see src/db/db_init.js

Structure

Rules:

  • One person may have multiple tabs
  • One tab may belong to multiple people

We have a many-to-many relationship and this must be broken down into multiple one to many relationship to abide by the rules of relational database system by making use of a junction table:

image

To further help visualisation, below are table creation queries:

CREATE TABLE IF NOT EXISTS users (
    user_id INTEGER PRIMARY KEY,
    name TEXT);

CREATE TABLE IF NOT EXISTS tabs (
    tab_id INTEGER PRIMARY KEY,
    amount INTEGER,
    description TEXT);

CREATE TABLE IF NOT EXISTS usertabs (
    usertabs_id INTEGER PRIMARY KEY,
    userID INTEGER,
    tabID INTEGER,
    tabStatus BOOLEAN DEFAULT 0,
    FOREIGN KEY (userID) REFERENCES users(user_id),
    FOREIGN KEY (tabID) REFERENCES tabss(tab_id));

TO-DO:

  • Initialise Node project
  • Setup portable database
  • Create tables: users, tabs, & usertabs
  • Functionality: display tabs based on its status: unpaid, paid, & all
  • Functionality: create new tab
  • Functionality: update tab
    • Functionality: Set tab to paid
  • Functionality: remove tab
  • Add CSS (to make it bearable to look at) (optional)

Author: Muhammad Naufal Al Ghifari