diff --git a/akashi.pro b/akashi.pro
index e649183..a839f1c 100644
--- a/akashi.pro
+++ b/akashi.pro
@@ -1,4 +1,7 @@
TEMPLATE = subdirs
SUBDIRS += \
- akashi
+ akashi \
+ lib
+
+akashi.depends = lib
diff --git a/akashi/akashi.pro b/akashi/akashi.pro
index 30b3001..8da7d72 100644
--- a/akashi/akashi.pro
+++ b/akashi/akashi.pro
@@ -23,39 +23,12 @@ MOC_DIR = $$PWD/../build
RC_ICONS = resource/icon/akashi.ico
-# Enable this to print network messages tothe console
-#DEFINES += NET_DEBUG
+SOURCES += main.cpp
-SOURCES += src/advertiser.cpp \
- src/aoclient.cpp \
- src/aopacket.cpp \
- src/area_data.cpp \
- src/commands/area.cpp \
- src/commands/authentication.cpp \
- src/commands/casing.cpp \
- src/commands/command_helper.cpp \
- src/commands/messaging.cpp \
- src/commands/moderation.cpp \
- src/commands/music.cpp \
- src/commands/roleplay.cpp \
- src/config_manager.cpp \
- src/db_manager.cpp \
- src/logger.cpp \
- src/main.cpp \
- src/packets.cpp \
- src/server.cpp \
- src/testimony_recorder.cpp \
- src/ws_client.cpp \
- src/ws_proxy.cpp
+# Include the akashi library
+win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/release/ -llib
+else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/debug/ -llib
+else:unix: LIBS += -L$$OUT_PWD/../lib/ -llib
-
-HEADERS += include/advertiser.h \
- include/aoclient.h \
- include/aopacket.h \
- include/area_data.h \
- include/config_manager.h \
- include/db_manager.h \
- include/logger.h \
- include/server.h \
- include/ws_client.h \
- include/ws_proxy.h
+INCLUDEPATH += $$PWD/../lib
+DEPENDPATH += $$PWD/../lib
diff --git a/akashi/src/main.cpp b/akashi/main.cpp
similarity index 97%
rename from akashi/src/main.cpp
rename to akashi/main.cpp
index ab475d3..03e8d90 100644
--- a/akashi/src/main.cpp
+++ b/akashi/main.cpp
@@ -15,9 +15,9 @@
// You should have received a copy of the GNU Affero General Public License //
// along with this program. If not, see . //
//////////////////////////////////////////////////////////////////////////////////////
-#include "include/advertiser.h"
-#include "include/server.h"
-#include "include/config_manager.h"
+#include
+#include
+#include
#include
diff --git a/akashi/include/advertiser.h b/lib/include/advertiser.h
similarity index 100%
rename from akashi/include/advertiser.h
rename to lib/include/advertiser.h
diff --git a/akashi/include/aoclient.h b/lib/include/aoclient.h
similarity index 100%
rename from akashi/include/aoclient.h
rename to lib/include/aoclient.h
diff --git a/akashi/include/aopacket.h b/lib/include/aopacket.h
similarity index 100%
rename from akashi/include/aopacket.h
rename to lib/include/aopacket.h
diff --git a/akashi/include/area_data.h b/lib/include/area_data.h
similarity index 100%
rename from akashi/include/area_data.h
rename to lib/include/area_data.h
diff --git a/akashi/include/config_manager.h b/lib/include/config_manager.h
similarity index 100%
rename from akashi/include/config_manager.h
rename to lib/include/config_manager.h
diff --git a/akashi/include/db_manager.h b/lib/include/db_manager.h
similarity index 100%
rename from akashi/include/db_manager.h
rename to lib/include/db_manager.h
diff --git a/akashi/include/logger.h b/lib/include/logger.h
similarity index 100%
rename from akashi/include/logger.h
rename to lib/include/logger.h
diff --git a/akashi/include/server.h b/lib/include/server.h
similarity index 100%
rename from akashi/include/server.h
rename to lib/include/server.h
diff --git a/akashi/include/ws_client.h b/lib/include/ws_client.h
similarity index 100%
rename from akashi/include/ws_client.h
rename to lib/include/ws_client.h
diff --git a/akashi/include/ws_proxy.h b/lib/include/ws_proxy.h
similarity index 100%
rename from akashi/include/ws_proxy.h
rename to lib/include/ws_proxy.h
diff --git a/lib/lib.cpp b/lib/lib.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/lib/lib.h b/lib/lib.h
new file mode 100644
index 0000000..e69de29
diff --git a/lib/lib.pro b/lib/lib.pro
new file mode 100644
index 0000000..93ea1e0
--- /dev/null
+++ b/lib/lib.pro
@@ -0,0 +1,46 @@
+QT += network websockets core sql
+QT -= gui
+
+TEMPLATE = lib
+
+CONFIG += shared c++11
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+# Enable this to print network messages tothe console
+#DEFINES += NET_DEBUG
+
+SOURCES += \
+ src/advertiser.cpp \
+ src/aoclient.cpp \
+ src/aopacket.cpp \
+ src/area_data.cpp \
+ src/commands/area.cpp \
+ src/commands/authentication.cpp \
+ src/commands/casing.cpp \
+ src/commands/command_helper.cpp \
+ src/commands/messaging.cpp \
+ src/commands/moderation.cpp \
+ src/commands/music.cpp \
+ src/commands/roleplay.cpp \
+ src/config_manager.cpp \
+ src/db_manager.cpp \
+ src/logger.cpp \
+ src/packets.cpp \
+ src/server.cpp \
+ src/testimony_recorder.cpp \
+ src/ws_client.cpp \
+ src/ws_proxy.cpp
+
+HEADERS += include/advertiser.h \
+ include/aoclient.h \
+ include/aopacket.h \
+ include/area_data.h \
+ include/config_manager.h \
+ include/db_manager.h \
+ include/logger.h \
+ include/server.h \
+ include/ws_client.h \
+ include/ws_proxy.h
diff --git a/akashi/src/advertiser.cpp b/lib/src/advertiser.cpp
similarity index 100%
rename from akashi/src/advertiser.cpp
rename to lib/src/advertiser.cpp
diff --git a/akashi/src/aoclient.cpp b/lib/src/aoclient.cpp
similarity index 100%
rename from akashi/src/aoclient.cpp
rename to lib/src/aoclient.cpp
diff --git a/akashi/src/aopacket.cpp b/lib/src/aopacket.cpp
similarity index 100%
rename from akashi/src/aopacket.cpp
rename to lib/src/aopacket.cpp
diff --git a/akashi/src/area_data.cpp b/lib/src/area_data.cpp
similarity index 100%
rename from akashi/src/area_data.cpp
rename to lib/src/area_data.cpp
diff --git a/akashi/src/commands/area.cpp b/lib/src/commands/area.cpp
similarity index 100%
rename from akashi/src/commands/area.cpp
rename to lib/src/commands/area.cpp
diff --git a/akashi/src/commands/authentication.cpp b/lib/src/commands/authentication.cpp
similarity index 100%
rename from akashi/src/commands/authentication.cpp
rename to lib/src/commands/authentication.cpp
diff --git a/akashi/src/commands/casing.cpp b/lib/src/commands/casing.cpp
similarity index 100%
rename from akashi/src/commands/casing.cpp
rename to lib/src/commands/casing.cpp
diff --git a/akashi/src/commands/command_helper.cpp b/lib/src/commands/command_helper.cpp
similarity index 100%
rename from akashi/src/commands/command_helper.cpp
rename to lib/src/commands/command_helper.cpp
diff --git a/akashi/src/commands/messaging.cpp b/lib/src/commands/messaging.cpp
similarity index 100%
rename from akashi/src/commands/messaging.cpp
rename to lib/src/commands/messaging.cpp
diff --git a/akashi/src/commands/moderation.cpp b/lib/src/commands/moderation.cpp
similarity index 100%
rename from akashi/src/commands/moderation.cpp
rename to lib/src/commands/moderation.cpp
diff --git a/akashi/src/commands/music.cpp b/lib/src/commands/music.cpp
similarity index 100%
rename from akashi/src/commands/music.cpp
rename to lib/src/commands/music.cpp
diff --git a/akashi/src/commands/roleplay.cpp b/lib/src/commands/roleplay.cpp
similarity index 100%
rename from akashi/src/commands/roleplay.cpp
rename to lib/src/commands/roleplay.cpp
diff --git a/akashi/src/config_manager.cpp b/lib/src/config_manager.cpp
similarity index 100%
rename from akashi/src/config_manager.cpp
rename to lib/src/config_manager.cpp
diff --git a/akashi/src/db_manager.cpp b/lib/src/db_manager.cpp
similarity index 100%
rename from akashi/src/db_manager.cpp
rename to lib/src/db_manager.cpp
diff --git a/akashi/src/logger.cpp b/lib/src/logger.cpp
similarity index 100%
rename from akashi/src/logger.cpp
rename to lib/src/logger.cpp
diff --git a/akashi/src/packets.cpp b/lib/src/packets.cpp
similarity index 100%
rename from akashi/src/packets.cpp
rename to lib/src/packets.cpp
diff --git a/akashi/src/server.cpp b/lib/src/server.cpp
similarity index 100%
rename from akashi/src/server.cpp
rename to lib/src/server.cpp
diff --git a/akashi/src/testimony_recorder.cpp b/lib/src/testimony_recorder.cpp
similarity index 100%
rename from akashi/src/testimony_recorder.cpp
rename to lib/src/testimony_recorder.cpp
diff --git a/akashi/src/ws_client.cpp b/lib/src/ws_client.cpp
similarity index 100%
rename from akashi/src/ws_client.cpp
rename to lib/src/ws_client.cpp
diff --git a/akashi/src/ws_proxy.cpp b/lib/src/ws_proxy.cpp
similarity index 100%
rename from akashi/src/ws_proxy.cpp
rename to lib/src/ws_proxy.cpp