Skip to content

Commit 799e13c

Browse files
committed
Flutter app added
1 parent 3068b4c commit 799e13c

File tree

102 files changed

+41099
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+41099
-20
lines changed

.gitignore

+44-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
1-
node_modules
2-
dist/
1+
# Miscellaneous
2+
*.class
33
*.log
4-
# user specific
5-
cache/
6-
local/
7-
# debian build specific
8-
deb-struct/usr/lib/
9-
deb-struct/usr/bin/
10-
deb-struct/usr/share/applications
11-
# deply build binaries
12-
deploy/linux/build
13-
deploy/win32/build
14-
deploy/darwin/build
15-
# aur build specific
16-
aur-struct/src
17-
aur-struct/pkg
18-
aur-struct/*.zip*
19-
aur-struct/*.zst
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
2011

21-
*.tsbuildinfo
22-
tsconfig.tsbuildinfo
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Web related
35+
lib/generated_plugin_registrant.dart
36+
37+
# Symbolication related
38+
app.*.symbols
39+
40+
# Obfuscation related
41+
app.*.map.json
42+
43+
# Android Studio will place build artifacts here
44+
/android/app/debug
45+
/android/app/profile
46+
/android/app/release

.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
8+
channel: stable
9+
10+
project_type: app

README.md

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
![Spotube](assets/spotube_banner.svg)
2+
3+
Spotube is a [qt](https://qt.io) based lightweight spotify client which uses [nodegui/react-nodegui](https://github.com/nodegui/react-nodegui) as frontend & nodejs as backend. It utilizes the power of Spotify & Youtube's public API & creates a hazardless, performant & resource friendly User Experience
4+
![Application Screenshot](assets/spotube-screenshot.png)
5+
6+
## Features
7+
8+
Following are the features that currently spotube offers:
9+
10+
- Open Source
11+
- No telementry, diagnostics or user data collection
12+
- Lightweight & resource friendly
13+
- Near native performance & seemless with default desktop themes (Win10, Win7, OSX, QT-default)
14+
- Playback control is on user's machine instead of server based
15+
- Small size & less data hungry
16+
- No spotify or youtube ads since it uses all public & free APIs (But it's recommended to support the creators by watching/liking/subscribing to the artists youtube channel or add as favourite track in spotify. Mostly buying spotify premium is the best way to support their valuable creations)
17+
- Lyrics
18+
- Downloadable track
19+
20+
## Requirements (Linux🐧 only)
21+
22+
Don't worry **spotify premium isn't required**😱. But some extra packages are required.
23+
24+
- [MPV](https://mpv.io/installation/) player for playing the actual audio
25+
- [youtube-dl](https://github.com/ytdl-org/youtube-dl) for streaming the audio from youtube. It already comes pre bundled with mpv
26+
27+
> **Important for [Ubuntu/Debian]():** If you're using any **ubuntu/debian** based linux distro then **youtube-dl** installed from the typical **apt-get** repositories will most likely not work as that version is older than current release. So remove it & install from the repository manually
28+
29+
Remove the **youtube-dl** installed with **mpv** player or from **apt package manger**
30+
31+
```bash
32+
$ sudo apt-get remove youtube-dl
33+
```
34+
35+
Now, Install youtube-dl from
36+
37+
- official github repo: https://github.com/ytdl-org/youtube-dl#installation (recommended)
38+
**or**
39+
- snap installation
40+
```bash
41+
$ snap install youtube-dl
42+
```
43+
44+
## Installation
45+
46+
I'm always releasing newer versions of binary of the software each 2-3 month with minor changes & each 6-8 month with major changes. Grab the binaries
47+
48+
All the binaries are located in the [releases](https://github.com/krtirtho/spotube/releases), just download
49+
50+
### Windows
51+
52+
Extract the **`Spotube-winx64-v<version>.zip`** & double click on **`install.bat`** & follow along the installer
53+
54+
### Linux
55+
56+
- **Ubuntu/Debian**
57+
Make sure you've fulfilled all the requirements
58+
```bash
59+
sudo apt install spotube_linux-x86_64-v<version>.deb
60+
or
61+
sudo dpkg -i spotube_linux-x86_64-v<version>.deb
62+
```
63+
- **Others**: Navigate to the downloaded **`Spotube_linux-x86_64-v<version>.AppImage`**
64+
file & double click to run it
65+
66+
**I'll/try to upload the package binaries to linux debian/arch/ubuntu/snap/flatpack/redhat/chocolatey stores or software centers or repositories**
67+
68+
## Configuration
69+
70+
There are some configurations that needs to be done to start using this software
71+
72+
You need a spotify account & a web app for
73+
74+
- clientId
75+
- clientSecret
76+
77+
**Grab credentials:**
78+
79+
- Go to https://developer.spotify.com/dashboard/login & login with your spotify account (Skip if you're logged in)
80+
![Step 1](https://user-images.githubusercontent.com/61944859/111762106-d1d37680-88ca-11eb-9884-ec7a40c0dd27.png)
81+
82+
- Create an web app for Spotify Public API
83+
![step 2](https://user-images.githubusercontent.com/61944859/111762507-473f4700-88cb-11eb-91f3-d480e9584883.png)
84+
85+
- Give the app a name & description. Then Edit settings & add **http://localhost:4304/auth/spotify/callback** as **Redirect URI** for the app. Its important for authenticating
86+
![setp-3](https://user-images.githubusercontent.com/61944859/111768971-d308a180-88d2-11eb-9108-3e7444cef049.png)
87+
88+
- Click on **SHOW CLIENT SECRET** to reveal the **clientSecret**. Then copy the **clientID**, **clientSecret** & paste in the **Spotube's** respective fields
89+
![step-4](https://user-images.githubusercontent.com/61944859/111769501-7fe31e80-88d3-11eb-8fc1-f3655dbd4711.png)
90+
91+
> **Note!**: No personal data or any kind of sensitive information won't be collected from spotify. Don't believe? See the code for yourself
92+
93+
### Building from source
94+
95+
**nodegui/react-nodegui** requires following packages to run
96+
97+
- [CMake](https://cmake.org/install/) 3.1 & up
98+
- GCC v7
99+
- Nodejs 12.x & up
100+
101+
**Windows Specific:**
102+
103+
- Visual Studio 2019
104+
105+
**MacOS & Linux specific:**
106+
107+
- Make
108+
109+
**Ubuntu/Debian based linux specific:**
110+
Having `pkg-config build-essential mesa-common-dev libglu1-mesa-dev` is important
111+
112+
```bash
113+
$ sudo apt-get install pkg-config build-essential mesa-common-dev libglu1-mesa-dev
114+
```
115+
116+
After having this dependencies set up run following commands:
117+
118+
```bash
119+
$ git clone https://github.com/KRTirtho/spotube.git
120+
$ cd spotube
121+
$ npm install
122+
```
123+
124+
Now start building:
125+
126+
```bash
127+
$ npm run build
128+
$ npm run pack
129+
```
130+
131+
Go to built package directory replace `os-name` with `linux`|`win32`|`darwin`:
132+
133+
```bash
134+
$ cd deploy/<os-name>/build/spotube
135+
```
136+
137+
If everything went smoothly then double clicking on the
138+
139+
- `AppRun` or Spotube-x86_64.AppImage for **linux**
140+
- qode.exe for **Windows**
141+
- Spotube-x86_64.dmg for **MacOS**
142+
143+
should work just fine without any problem
144+
145+
### Development
146+
147+
Follow the **Build from Source** guideline till `npm install`
148+
Now, to start the dev server run the command in one terminal:
149+
150+
```bash
151+
$ npm run dev
152+
```
153+
154+
To start the application in development environment run following command in another terminal keeping the dev server running:
155+
156+
```bash
157+
$ npm start
158+
```
159+
160+
## Known Issues
161+
162+
There will be some glitches, lags & stuck motions because of the library Spotube is currently using under the hood. It has some issues with layouts thus sometimes some contents aren't shown or overflows out of the window. But resizing the window would fix this issue. Soon there will be some updates fixing this sort of layout related problems
163+
164+
## TODO:
165+
166+
- [ ] Compile, Debug & Build for **MacOS**
167+
- [x] Add support for show Lyric of currently playing track
168+
- [x] Track download
169+
- [x] Cached playback
170+
- [ ] Support for playing/streaming podcasts/shows
171+
- [x] Easy installation procedure/mechanism for simplicity in Windows
172+
- [ ] Artist, User & Album pages
173+
174+
## Things that don't work
175+
176+
- Shows & Podcasts aren't supported as it'd require premium anyway
177+
- Beautiful UI (you missed it, see the title😂👆)
178+
- OS Media Controls
179+
180+
#### Social handlers
181+
182+
Follow me on [Twitter](https://twitter.com/@krtirtho) for newer updates about this application

analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

android/.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

android/app/build.gradle

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion flutter.compileSdkVersion
30+
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = '1.8'
38+
}
39+
40+
sourceSets {
41+
main.java.srcDirs += 'src/main/kotlin'
42+
}
43+
44+
defaultConfig {
45+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46+
applicationId "com.example.spotube"
47+
minSdkVersion flutter.minSdkVersion
48+
targetSdkVersion flutter.targetSdkVersion
49+
versionCode flutterVersionCode.toInteger()
50+
versionName flutterVersionName
51+
}
52+
53+
buildTypes {
54+
release {
55+
// TODO: Add your own signing config for the release build.
56+
// Signing with the debug keys for now, so `flutter run --release` works.
57+
signingConfig signingConfigs.debug
58+
}
59+
}
60+
}
61+
62+
flutter {
63+
source '../..'
64+
}
65+
66+
dependencies {
67+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.spotube">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>

0 commit comments

Comments
 (0)