Skip to content

A .NET project designed to demonstrate a C# console application using SQL Server, Dapper, and Docker. It features flashcard stack management, practice sessions, and study statistics, with unit and integration tests written in xUnit using NSubstitute

License

Notifications You must be signed in to change notification settings

Dejmenek/Flashcards

Repository files navigation

Flashcards

Table of Contents

General Info

Flashcards is a modern, feature-rich flashcard application built with C# and .NET 9, designed to help users efficiently learn and retain information.
It supports creating and managing stacks of flashcards with various card types, including basic, multiple choice and cloze deletion.
The application implements the Leitner System for spaced repetition, allowing users to optimize their study sessions.

Technologies

  • C#
  • SQL Server
  • Dapper
  • Spectre.Console
  • Docker
  • XUnit
  • NSubstitute
  • TestContainers

Features

  • Create and manage stacks of flashcards.
  • Support for multiple flashcard types: basic, multiple choice and cloze deletion.
  • Practise flashcards with spaced repetition using the Leitner System.
  • Review study sessions statistics, including monthly reports (average score, number of sessions per stack).
  • User-friendly interface: Provides clear menus and prompts for interaction.
  • (Planned) Generate flashcards from text files or other formats.

Instalation and Setup

You can run the Flashcards app either locally or using Docker.

Local Setup

Steps

  1. Clone or download this project repository.
  2. Open the solution file (Flashcards.Dejmenek.sln) in Visual Studio.
  3. Install the required NuGet packages
  4. Update the appsettings.json file.
    • Make sure you have two connection strings:
       {
       	"ConnectionStrings": {
       		"Default": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=Flashcards;Integrated Security=True;",
       		"Master": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;"
       	}
       }
      
  5. Build and Run the application from Visual Studio or CLI.

Docker

Prerequisites

  • Docker installed on your machine.
  • Docker Compose installed.

Steps

  1. Clone or download this project repository.
  2. Navigate to the project directory in your terminal.
  3. Run the following command to build and start the Docker containers:
    docker-compose up -d --build

Accessing the Application

Once the containers are running, you can access the application through the terminal. You can run the application using the following command:

docker compose run --service-ports -it flashcards

Examples

  • Main Menu
    image
  • Manage Stacks
    image
    image
  • Manage Flashcards
    image
  • Card Types
    • Basic Card
      image
    • Multiple Choice
      image
    • Cloze Deletion
      image
  • Study Session
    study_example.mp4
  • View Study Sessions
    image
  • View monthly study session reports per stack:
    • Average Score
      image
    • Number of sessions
      image

Things Learned

I have some previous experience with other DBMS like MySQL and SQLite so using SQL Server wasn't that hard.
I only had to look up for data types and how to create pivot tables.

I've also learned about Data Transfer Objects (DTOs).
They provide a clean way to transfer data between different layers of an application, reducing the amount of unnecessary data sent.

Working with Docker taught me how to containerize .NET applications and manage dependencies in isolated environments.
I learned how to write Dockerfiles, use Docker Compose for multi-container setups, and troubleshoot common issues related to networking and persistent storage.

Implementing GitHub Actions introduced me to automating CI/CD workflows.
I learned how to set up automated builds and tests for pull requests.

Used Resources

TODO

  • Add unit tests for the application.
  • Add integration tests for the application.
  • Add more card types (e.g., multiple choice, cloze).
  • Leitner System implementation for spaced repetition.
  • Generate flashcards from text files or other formats.

About

A .NET project designed to demonstrate a C# console application using SQL Server, Dapper, and Docker. It features flashcard stack management, practice sessions, and study statistics, with unit and integration tests written in xUnit using NSubstitute

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published