coursewatcher 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/bin/coursewatcher.js +43 -0
- package/package.json +57 -0
- package/public/css/styles.css +935 -0
- package/public/js/player.js +316 -0
- package/src/controllers/video-controller.js +173 -0
- package/src/models/database.js +169 -0
- package/src/server.js +152 -0
- package/src/services/notes-service.js +97 -0
- package/src/services/progress-service.js +148 -0
- package/src/services/video-service.js +322 -0
- package/src/utils/config.js +56 -0
- package/src/utils/errors.js +57 -0
- package/src/utils/logger.js +48 -0
- package/views/layouts/main.ejs +13 -0
- package/views/pages/error.ejs +25 -0
- package/views/pages/index.ejs +101 -0
- package/views/pages/player.ejs +118 -0
- package/views/pages/search.ejs +63 -0
- package/views/partials/footer.ejs +3 -0
- package/views/partials/head.ejs +8 -0
- package/views/partials/header.ejs +14 -0
- package/views/partials/video-card.ejs +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# CourseWatcher
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/coursewatcher)
|
|
4
|
+
[](https://www.npmjs.com/package/coursewatcher)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**A CLI tool and web interface for tracking progress in downloaded video courses.**
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Navigate to your course folder
|
|
14
|
+
cd /path/to/my-course
|
|
15
|
+
|
|
16
|
+
# Run CourseWatcher
|
|
17
|
+
npx coursewatcher
|
|
18
|
+
|
|
19
|
+
# Or with options
|
|
20
|
+
npx coursewatcher --port 8080 --no-browser
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g coursewatcher
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- 📺 **Video Tracking** — Automatically tracks watch status and playback position
|
|
32
|
+
- 📁 **Module Grouping** — Groups videos by folder structure
|
|
33
|
+
- 🎮 **Smart Player** — Keyboard shortcuts for speed/seek control
|
|
34
|
+
- 🔍 **Video Search** — Find videos by name
|
|
35
|
+
- 📝 **Notes** — Markdown notes for each video
|
|
36
|
+
- 💾 **Portable Data** — Progress stored in `.coursewatcher` folder next to videos
|
|
37
|
+
|
|
38
|
+
## Keyboard Shortcuts
|
|
39
|
+
|
|
40
|
+
| Key | Action |
|
|
41
|
+
|-----|--------|
|
|
42
|
+
| `Space` | Play/Pause |
|
|
43
|
+
| `W` | Decrease speed |
|
|
44
|
+
| `E` | Increase speed |
|
|
45
|
+
| `J` | Seek back 5s |
|
|
46
|
+
| `K` | Seek forward 5s |
|
|
47
|
+
| `L` | Seek forward 10s |
|
|
48
|
+
| `Shift+J` | Seek back 30s |
|
|
49
|
+
| `Shift+L` | Seek forward 30s |
|
|
50
|
+
| `M` | Mute/Unmute |
|
|
51
|
+
| `F` | Fullscreen |
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Install dependencies
|
|
57
|
+
npm install
|
|
58
|
+
|
|
59
|
+
# Run in development
|
|
60
|
+
npm run dev
|
|
61
|
+
|
|
62
|
+
# Run tests
|
|
63
|
+
npm test
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CourseWatcher CLI Entry Point
|
|
5
|
+
*
|
|
6
|
+
* Main executable for the coursewatcher command.
|
|
7
|
+
* Parses arguments and starts the web server.
|
|
8
|
+
*
|
|
9
|
+
* @module bin/coursewatcher
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const { program } = require('commander');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { version, description } = require('../package.json');
|
|
15
|
+
const { startServer } = require('../src/server');
|
|
16
|
+
const { log, success, error } = require('../src/utils/logger');
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name('coursewatcher')
|
|
20
|
+
.description(description)
|
|
21
|
+
.version(version)
|
|
22
|
+
.argument('[path]', 'path to course directory', '.')
|
|
23
|
+
.option('-p, --port <number>', 'server port', '3000')
|
|
24
|
+
.option('--no-browser', 'do not open browser automatically')
|
|
25
|
+
.action(async (coursePath, options) => {
|
|
26
|
+
try {
|
|
27
|
+
const absolutePath = path.resolve(coursePath);
|
|
28
|
+
const port = parseInt(options.port, 10);
|
|
29
|
+
|
|
30
|
+
log(`Starting CourseWatcher in: ${absolutePath}`);
|
|
31
|
+
|
|
32
|
+
await startServer({
|
|
33
|
+
coursePath: absolutePath,
|
|
34
|
+
port,
|
|
35
|
+
openBrowser: options.browser,
|
|
36
|
+
});
|
|
37
|
+
} catch (err) {
|
|
38
|
+
error(`Failed to start CourseWatcher: ${err.message}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "coursewatcher",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A CLI tool and web interface for tracking progress in downloaded video courses",
|
|
5
|
+
"main": "src/server.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"coursewatcher": "./bin/coursewatcher.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node bin/coursewatcher.js",
|
|
11
|
+
"dev": "node bin/coursewatcher.js",
|
|
12
|
+
"test": "jest",
|
|
13
|
+
"test:coverage": "jest --coverage",
|
|
14
|
+
"test:watch": "jest --watch"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"video",
|
|
18
|
+
"course",
|
|
19
|
+
"tracker",
|
|
20
|
+
"education",
|
|
21
|
+
"cli",
|
|
22
|
+
"progress",
|
|
23
|
+
"learning",
|
|
24
|
+
"tutorial"
|
|
25
|
+
],
|
|
26
|
+
"author": "Serhii Shtokal <serhiishtokal@gmail.com>",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/serhiishtokal/CourseWatcher.git"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/serhiishtokal/CourseWatcher#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/serhiishtokal/CourseWatcher/issues"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"bin/",
|
|
38
|
+
"src/",
|
|
39
|
+
"views/",
|
|
40
|
+
"public/"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"better-sqlite3": "^11.6.0",
|
|
44
|
+
"chalk": "^4.1.2",
|
|
45
|
+
"commander": "^12.1.0",
|
|
46
|
+
"ejs": "^3.1.10",
|
|
47
|
+
"express": "^4.21.1",
|
|
48
|
+
"open": "^8.4.2"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"jest": "^29.7.0",
|
|
52
|
+
"supertest": "^7.0.0"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|