diff --git a/README.md b/README.md index 3babd66e7f246db6d9c96bd5a3cd8a786b4ae3e1..88a3f868f3bab9dfc4208bc269d82686be5a46c4 100644 --- a/README.md +++ b/README.md @@ -1 +1,45 @@ -# LibreHomework \ No newline at end of file +# LibreHomework + +LibreHomework is an app made by students and for students. Features +- Adding and removing tasks which are notified by a daemon (only in GNU/Linux) +- Manage your subjects +- Lock your screen to prevent distractions +- Manage your exams (coming soon!) +- Manage your Documents (coming soon!) +- Custom network where you can meet other students through their profiles (50% done) +- Available in multiple languages + +## Project info +The project is divided in 3 parts: +- [The app/client](https://github.com/HGEpro/LibreHomework/tree/master/app) is written with Rust (backend) and [Tauri](https://github.com/tauri-apps/tauri) + [Svelte](https://github.com/sveltejs/svelte) (frontend). Why did we choose Tauri? Because it's an amazing framework that allows you to write Electron-like desktop apps with [much less resource consumption](https://github.com/tauri-apps/tauri#comparison-between-tauri-and-electron) while still using flexible web technologies. Why Svelte? We all know javascript has lots of frameworks, but Svelte is intuitive and easy to use while at the same time fast as there's no virtual DOM. +- [The daemon](https://github.com/HGEpro/LibreHomework/tree/master/daemon) is written with pure Rust to achieve a low resource consumption. It can be configured by editing the daemonconfig.json in the `.config/LibreHomework` file, but now it needs to be done manually. +- [The server](https://github.com/HGEpro/LibreHomework/tree/master/server) is written in Python with [Sanic](https://github.com/sanic-org/sanic) and postgresql. Why did we choose Python for the server? At first, it was intended to be written with Rust and Rocket.rs, but we finally decided to use python due to security concerns in the SQL library (injections). + +## Installation +You can found the compiled releases in the [Releases section](https://github.com/HGEpro/LibreHomework/releases). + +## Setup +To run or compile the app from source, you can use the following commands: + +``` +$ cd LibreHomework/app +$ npm i +``` +For running the app, you can use: +``` +$ npm run tauri dev +``` +And for building the app you can use: +``` +$ npm run tauri build +``` + +## Contributing +If you want to contribute to the project, you can fork the project and make your changes or just open a pull request. + +## Credits +Thanks to [Wolfram](https://github.com/fabiopolancoe) for the UI code and [YeahNotSewerSide](https://github.com/DoctorEenot) for the technical support. + +## Additional info +This project has been created for the [YH4F](https://fsfe.org/activities/yh4f/) 2021-2022. + diff --git a/app/src/Dialog.svelte b/app/src/Dialog.svelte index fc24d84da5f6515f680ba2ee91669bb7c9769815..1d151f8163f192fdd9d0e9c77bbc5c28ed8af902 100644 --- a/app/src/Dialog.svelte +++ b/app/src/Dialog.svelte @@ -36,11 +36,11 @@ if (!taskData.name && !taskData.subject && !taskData.date && !taskData.time) return; let tempDate = taskData.jsDate.valueAsDate; - tempDate.setDate(tempDate.getDate() + 1); + tempDate.setDate(tempDate.getDate()); tempDate.setHours( taskData.time.match( /(\d{2}):\d{2}/ )[1] ); tempDate.setMinutes( taskData.time.match( /\d{2}:(\d{2})/ )[1] ); - + console.log(tempDate.getTime()) if (tempDate.getTime() < Date.now()) { dateError = "date_past"; return; diff --git a/daemon/src/main.rs b/daemon/src/main.rs index 09ba2dd3320759e977a7a546e44976b1030a1f9e..fe10cab1578ee1cdedb9b167d2c60b19acec7e63 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -52,7 +52,6 @@ fn main() { notify(LogType::Warning, &format!("Task {} is expired", task.name)); } else { - println!("{}", task.expires_at - unix_now()); notify(LogType::Info, &format!("Task {} expires in {}", task.name, choose_time(task.expires_at))); } @@ -75,11 +74,8 @@ fn unix_now() -> u64 { fn choose_time(expires_at: u64) -> String { - println!("expires_at: {}", expires_at); let now = unix_now(); - println!("now: {}", now); let diff = expires_at - now; - println!("diff: {}", diff); if diff < 60 { return "less than a minute".to_string();