Project

General

Profile

Music streaming server made with Wt

Added by Emeric Poupon over 4 years ago

Hello,

In my free time I work on a self-hosted music server made with Wt: https://github.com/epoupon/lms

I think it is now mature enough to worth talking about it. I have set up a demo website here: https://lms.demo.poupon.io/artists (it is hosted on a Raspberry Pi3+, but the TLS part is offloaded on another front end server)

Note that since I am not a web designer it unfortunately does not look as good as I would like!

Some feedbacks for this project:

- compilation time is sometimes annoying (had to forward declare as many things as possible)

- I really like the way Wt makes it easy to do very reactive interfaces, making a website in C is really not a pain!

- I am really pleased with the general low memory requirement of wt,

  • I got sometimes struggle with bootstrap and the extra

generated from WTemplate

- Dbo is really powerfull, but I had to do some ugly code to generate dynamic "where" clauses mixing and/or keywords,

- using Sqlite3 backend efficiently in a multithreading environnment is not that easy (had to do a unique/shared lock wrapper around transactions)

- it's a shame that there is no more wt maintainer on debian distributions :(

  • support from forums/bug tracker is really appreciated, thanks again for that!

Emeric


Replies (6)

RE: Music streaming server made with Wt - Added by Roel Standaert over 4 years ago

Wow, that's cool.

I was thinking about deploying something like that so I could listen to all of the music I have in my collection from anywhere, mostly because some of the artists I listen to are missing on Spotify. A lot of self-hosted music servers seem just kind of clunky. I think I had an Ampache server, like, 8 years ago.

Note that since I am not a web designer it unfortunately does not look as good as I would like!

It looks like this is still one of the better looking self-hosted music servers, I must say. There's something to be said for just using Bootstrap and keeping it super simple if you're not a web designer.

I got sometimes struggle with bootstrap and the extra

generated from WTemplate

Yeah, it's not always ideal. There's a technical reason for that: Wt needs a DOM element to update.

RE: Music streaming server made with Wt - Added by Emeric Poupon over 4 years ago

Thanks for your feedback!

I was thinking about deploying something like that so I could listen to all of the music I have in my collection from anywhere, mostly because some of the artists I listen to are missing on Spotify. A lot of self-hosted music servers seem just kind of clunky.

This is exactly why I did this :)

Feel free to test it. I think I will provide .deb packages for raspbian 10 in near future. But again what a shame there is no witty4 .deb packages.

RE: Music streaming server made with Wt - Added by lm at over 4 years ago

This looks great!

Regarding compilation times, are you using a precompiled header? It helps a ton. Let me know if you want any tips about that. Also, make sure your compiler is using the precompiled header!

I don't use a debian distribution, so I won't be helping with that!

RE: Music streaming server made with Wt - Added by Wim Dumon over 4 years ago

Hello Emeric,

Nice application, thanks for letting us know what you're working on!

Wim.

RE: Music streaming server made with Wt - Added by Emeric Poupon over 4 years ago

Regarding compilation times, are you using a precompiled header? It helps a ton. Let me know if you want any tips about that. Also, make sure your compiler is using the precompiled header!

Actually I don't. What do you typically put into it? Just Wt or some of your application headers too?

Nice application, thanks for letting us know what you're working on!

You're welcome, thanks to you for making Wt what it is today!

RE: Music streaming server made with Wt - Added by lm at over 4 years ago

Here's an example:

#include <log4cpp/Category.hh>
#include "logging.hpp"
#include <Wt/Auth/AuthService>
#include <Wt/Auth/AuthWidget>
#include <Wt/Auth/Dbo/UserDatabase>
#include <Wt/Auth/HashFunction>
#include <Wt/Auth/Login>
#include <Wt/Auth/Dbo/AuthInfo>
#include <Wt/Auth/PasswordService>
#include <Wt/Auth/PasswordVerifier>
#include <Wt/Dbo/backend/Sqlite3>
#include <Wt/Dbo/Dbo>
#include <Wt/Dbo/Session>
#include <Wt/WApplication>
#include <chrono>
#include <memory>
#include <random>
#include <vector>

No need for header guards. Things that go in here are things that are needed in more than one translation unit, but they don't change much. That will include library headers, system headers, and in my case, my logging configuration. This latter might not be a great idea; depends on what you want. Any time I change logging.hpp, the precompiled header has to be re-built.

I use "hand-written" Makefiles: https://sourceforge.net/p/christmas-list/code/ci/master/tree/Makefile . So, everything depends on the precompiled header, and the precompiled header recipe is on line 52. Each build engine has its own way of dealing with this.

    (1-6/6)