tempie 0.5.5

Jira time tracking CLI tool
Documentation
diff --git a/.gitignore b/.gitignore
index 2f710ac..de358ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
 /target
-tempie.db
 .vscode/
diff --git a/Cargo.lock b/Cargo.lock
index ebe7ef9..4d417fe 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2166,6 +2166,7 @@ dependencies = [
  "tabled",
  "tokio",
  "webbrowser",
+ "xdg-home",
 ]
 
 [[package]]
@@ -2967,6 +2968,16 @@ version = "0.5.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
 
+[[package]]
+name = "xdg-home"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"
+dependencies = [
+ "libc",
+ "windows-sys 0.59.0",
+]
+
 [[package]]
 name = "yaml-rust2"
 version = "0.10.1"
diff --git a/Cargo.toml b/Cargo.toml
index 590d6e8..cae4d29 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,6 +27,7 @@ spinners = "4.1.1"
 tabled = {version = "0.18.0", features = ["ansi"]}
 tokio = {version = "1", features = ["full"]}
 webbrowser = "1.0"
+xdg-home = "1.3.0"
 
 [[bin]]
 name = "tempie"
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 5160926..8112cb3 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -9,8 +9,7 @@ use tabled::{
     builder::Builder,
     settings::object::Rows,
     settings::style::BorderSpanCorrection,
-    settings::{Alignment, Span},
-    settings::{Color, Style},
+    settings::{Alignment, Span, Color, Style},
 };
 
 pub async fn list(api: &ApiClient, from_date: &str, to_date: &str) {
diff --git a/src/storage.rs b/src/storage.rs
index 6f0621f..46f6205 100644
--- a/src/storage.rs
+++ b/src/storage.rs
@@ -1,7 +1,8 @@
+use crate::models::{JiraIssue, UserCredentials};
 use serde_json;
 use sled;
-
-use crate::models::{JiraIssue, UserCredentials};
+use std::path::PathBuf;
+use xdg_home::home_dir;
 
 pub struct Storage {
     db: sled::Db,
@@ -9,7 +10,7 @@ pub struct Storage {
 
 impl Storage {
     pub fn new() -> Self {
-        Self::with_path("tempie.db")
+        Self::with_path(Self::get_db_path("tempie.db").to_str().unwrap())
     }
 
     pub fn with_path(path: &str) -> Self {
@@ -23,6 +24,18 @@ impl Storage {
         Self { db }
     }
 
+    pub fn get_db_path(db_name: &str) -> PathBuf {
+        let home = home_dir().unwrap();
+
+        let tempie_dir = home.join(".tempie");
+
+        if !tempie_dir.exists() {
+            std::fs::create_dir_all(&tempie_dir).expect("Could not create .tempie directory");
+        }
+
+        tempie_dir.join(db_name)
+    }
+
     // Store Jira credentials
     pub fn store_credentials(&self, creds: UserCredentials) -> UserCredentials {
         let serialized = serde_json::to_string(&creds).unwrap();