Habit Logger

This is an entry-level C# application that will allow the user to track a habit of choice: the console interface connected to the database.

The goal

This is a simple console application that reads user's commands via input. It's totally up to you how you organize the interaction but there are some requirements:

  • The application should handle user input to execute CRUD (create, retrieve, update, delete) data of ONE habit of choice.
  • All errors should be handled so the application never crashes. 
What you will learn
  1. Creating a file with code
  2. Taking user input from the console
  3. Printing data to the user on the console.
  4. Working with basic C# libraries.
  5. Basic control flow, conditional statements and loops
  6. Connecting to a local database
  7. Basics of SQL (the language you use to communicate with the database).
Preliminary material

This is a summary of all steps necessary to prepare for this initial course. It contains links to basic tutorials and documentation you'll need to complete this course: CappuccinoCoding - Habit Tracker

Acceptance criteria
  1. This is an application where you’ll register one habit.
  2. The application should store and retrieve data from a SQlite database.
  3. When the application starts, it should create a sqlite database, if one isn’t present.
  4. It should also create a table in the database, where the hours will be logged.
  5. The app should show the user a menu of options.
  6. The users should be able to insert, delete, update and view their logged hours.
  7. You should handle all possible errors so that the application never crashes
  8. The application should only be terminated when the user inserts 0.
  9. Create a git repository for the project so I can have a look at the code and follow your progress.
  10. You can only interact with the database using raw SQL. You can’t use mappers such as Entity Framework.
Step 1. ASP.NET C# Environment

If this is your first contact with ASP.NET C#, we have some setting up to do. Check out this article with everything you need to prepare your environment to work with C#! 

Step 2. Basic C#

It’s time to start coding! Welcome to fantastic world of C#! If you haven’t yet, checkout the C# First Steps article. You’ll need to set up your C# developer environment before starting.

Now it’s time to learn the basic C# syntax. You need to be familiar with a few concepts and techniques before jumping into your first real project. The way you’ll attack this first contact with the language will depend on your learning style, but here’s my advice: Don’t try to understand EVERYTHING before moving starting to build.

Here's a link with resources to learn the basics. It could take a couple of days or many weeks to go through the material, depending on the amount of time you dedicate to it. 

Make notes, reread, rewatch the tutorials, but don't over do it! You'll only learn with practice. Once you feel ready, move to 3. And don't forget to reach out if you have any questions.


No posts yet! Share your experience with this project, help others, ask and answer questions, get feedback