Skip to content
 
 

Latest commit

 

History

586 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Console Habit Tracker

Console Based CRUD application to track any habit using C# and SQLite.

Given Requirements:

  • When the application starts, it should create a sqlite database, if one isn’t present.
  • This habit can't be tracked by time (ex. hours of sleep), only by quantity (ex. number of water glasses a day)
  • Users need to be able to input the date of the occurrence of the habit
  • The application should store and retrieve data from a real database
  • It should also create a table in the database, where the habit will be logged.
  • The users should be able to insert, delete, update and view their logged habit.
  • You should handle all possible errors so that the application never crashes.
  • You can only interact with the database using ADO.NET. You can’t use mappers such as Entity Framework or Dapper.
  • Follow the DRY Principle, and avoid code repetition.
  • Your project needs to contain a Read Me file where you'll explain how your app works and tell a little bit about your thought progress. What was hard? What was easy? What have you learned?

Features

  • SQLite database connection

    • The program uses a SQLite db connection to store and read information.
    • If no database exists, or the correct table does not exist they will be created on program start.
  • A console based UI where users can navigate by key presses

    • image
  • CRUD DB functions

    • From the main menu users can Create, Read, Update or Delete entries for whichever date they want, entered in mm-DD-yyyy format.
    • Time and Dates inputted are checked to make sure they are in the correct and realistic format.
  • Added Feature to let user decide on habit and even add any amount of habits

Technology Stack

  • C# (.NET)
  • SQLite (Microsoft.Data.Sqlite)
  • ADO.NET (Raw SQL queries, no ORMs like Dapper or Entity Framework)

Challenges

  • First application involving SQLite but not first time using SQL
  • Syntax of ADO.NET new to me so had to understand first.

Lesson Learned

  • SQLite Data Types: SQLite doesn't have a native boolean data type.
  • Tried to keep methods simple
  • Always create a new git branch for each issue or feature that is currently being worked on.

Resources Used

About

Habit-logger with SQL database through ADO.NET

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages