1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-21 18:44:19 +00:00

Start working on the new version

This commit is contained in:
Steffo 2024-07-04 03:15:39 +02:00
parent 560e79e0ae
commit 1d69eb7f6e
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
30 changed files with 2541 additions and 4 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/target
.env

6
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

17
.idea/dataSources.xml Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="royalnet@localhost" uuid="a5d4ed39-c2a2-492a-929f-ae3610a8efdf">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/royalnet</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

194
.idea/icon.svg Normal file
View file

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<svg:svg height="100%" id="emblematic-background" inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)" sodipodi:docname="bg.svg" version="1.1" viewBox="0 0 2048 2048" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview bordercolor="#ffffff" borderopacity="1" id="namedview194" inkscape:current-layer="svg" inkscape:cx="1584.6862" inkscape:cy="882.08575" inkscape:deskcolor="#505050" inkscape:pagecheckerboard="1" inkscape:pageopacity="0" inkscape:showpageshadow="0" inkscape:window-height="1019" inkscape:window-maximized="1" inkscape:window-width="1920" inkscape:window-x="1280" inkscape:window-y="32" inkscape:zoom="0.32593203" pagecolor="#505050" showgrid="false"/>
<svg:defs id="defs">
<svg:linearGradient gradientUnits="userSpaceOnUse" id="bg-gradient" x1="-16.57" x2="2100.85" y1="2168.63" y2="-160.54">
<svg:stop id="stop4" offset="0" stop-color="#e76608"/>
<svg:stop id="stop6" offset="0.11" stop-color="#ca591b"/>
<svg:stop id="stop8" offset="0.32" stop-color="#9b453c"/>
<svg:stop id="stop10" offset="0.52" stop-color="#74375b"/>
<svg:stop id="stop12" offset="0.71" stop-color="#542e6f"/>
<svg:stop id="stop14" offset="0.87" stop-color="#42277a"/>
<svg:stop id="stop16" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="orb-gradient" x1="622.07" x2="1515.79" y1="1484.77" y2="265.15">
<svg:stop id="stop19" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop21" offset="0.65" stop-color="#846895"/>
<svg:stop id="stop23" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-10-gradient" x1="91.96" x2="1726.67" y1="753.71" y2="385.42">
<svg:stop id="stop26" offset="0.08" stop-color="#ffecb3"/>
<svg:stop id="stop28" offset="0.18" stop-color="#f8e6af"/>
<svg:stop id="stop30" offset="0.32" stop-color="#e6d3a9"/>
<svg:stop id="stop32" offset="0.48" stop-color="#c7b09e"/>
<svg:stop id="stop34" offset="0.67" stop-color="#9e819a"/>
<svg:stop id="stop36" offset="0.88" stop-color="#61488b"/>
<svg:stop id="stop38" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-1-gradient" x1="540.25" x2="1436.65" y1="983.05" y2="163.09">
<svg:stop id="stop41" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop43" offset="0.13" stop-color="#edd9aa"/>
<svg:stop id="stop45" offset="0.56" stop-color="#927598"/>
<svg:stop id="stop47" offset="0.86" stop-color="#523b86"/>
<svg:stop id="stop49" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-2-gradient" x1="669.81" x2="1792.05" y1="915.19" y2="661.55">
<svg:stop id="stop52" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop54" offset="0.3" stop-color="#c6af9f"/>
<svg:stop id="stop56" offset="0.64" stop-color="#7d6293"/>
<svg:stop id="stop58" offset="0.88" stop-color="#4e3685"/>
<svg:stop id="stop60" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-3-gradient" x1="780.87" x2="1908.32" y1="1194.97" y2="618.21">
<svg:stop id="stop63" offset="0.08" stop-color="#ffecb3"/>
<svg:stop id="stop65" offset="0.1" stop-color="#f9e5ae"/>
<svg:stop id="stop67" offset="0.43" stop-color="#ae9199"/>
<svg:stop id="stop69" offset="0.7" stop-color="#6e558e"/>
<svg:stop id="stop71" offset="0.9" stop-color="#493283"/>
<svg:stop id="stop73" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-9-gradient" x1="-33.67" x2="1211.81" y1="227.57" y2="1240.48">
<svg:stop id="stop76" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop78" offset="0.11" stop-color="#f9e7ae"/>
<svg:stop id="stop80" offset="0.26" stop-color="#ead7ab"/>
<svg:stop id="stop82" offset="0.42" stop-color="#d1bba3"/>
<svg:stop id="stop84" offset="0.6" stop-color="#ae9199"/>
<svg:stop id="stop86" offset="0.8" stop-color="#7b5f92"/>
<svg:stop id="stop88" offset="0.99" stop-color="#3e2780"/>
<svg:stop id="stop90" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-4-gradient" x1="1977.61" x2="973.93" y1="573.35" y2="1536.48">
<svg:stop id="stop93" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop95" offset="0.1" stop-color="#f7e3ae"/>
<svg:stop id="stop97" offset="0.26" stop-color="#e3cea6"/>
<svg:stop id="stop99" offset="0.46" stop-color="#c1a89c"/>
<svg:stop id="stop101" offset="0.69" stop-color="#8e7297"/>
<svg:stop id="stop103" offset="0.94" stop-color="#4d3485"/>
<svg:stop id="stop105" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-5-gradient" x1="903.59" x2="1605.26" y1="1659.09" y2="875.65">
<svg:stop id="stop108" offset="0.14" stop-color="#ffecb3"/>
<svg:stop id="stop110" offset="0.37" stop-color="#c7af9e"/>
<svg:stop id="stop112" offset="0.67" stop-color="#7e6293"/>
<svg:stop id="stop114" offset="0.89" stop-color="#4e3685"/>
<svg:stop id="stop116" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-8-gradient" x1="190.53" x2="1148.33" y1="1319.32" y2="249.9">
<svg:stop id="stop119" offset="0.14" stop-color="#ffecb3"/>
<svg:stop id="stop121" offset="0.23" stop-color="#f7e3ae"/>
<svg:stop id="stop123" offset="0.37" stop-color="#e2cea7"/>
<svg:stop id="stop125" offset="0.54" stop-color="#c0a89d"/>
<svg:stop id="stop127" offset="0.74" stop-color="#8e7097"/>
<svg:stop id="stop129" offset="0.95" stop-color="#4b3283"/>
<svg:stop id="stop131" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-6-gradient" x1="740.45" x2="1010.63" y1="1598.17" y2="511.86">
<svg:stop id="stop134" offset="0.04" stop-color="#ffecb3"/>
<svg:stop id="stop136" offset="0.24" stop-color="#dcc7a5"/>
<svg:stop id="stop138" offset="0.69" stop-color="#806594"/>
<svg:stop id="stop140" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-7-gradient" x1="88.46" x2="1349.68" y1="1239.21" y2="1289.58">
<svg:stop id="stop143" offset="0.43" stop-color="#ffecb3"/>
<svg:stop id="stop145" offset="0.51" stop-color="#ecd7ab"/>
<svg:stop id="stop147" offset="0.67" stop-color="#b99f9a"/>
<svg:stop id="stop149" offset="0.9" stop-color="#61488b"/>
<svg:stop id="stop151" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farleft-spike-gradient" x1="125.6" x2="646.06" y1="1086.67" y2="2000.27">
<svg:stop id="stop154" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop156" offset="0.31" stop-color="#e77d16"/>
<svg:stop id="stop158" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farleft-shine-gradient" x1="471.9" x2="69.99" y1="1445.89" y2="1142.12">
<svg:stop id="stop161" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop163" offset="0.13" stop-color="#fde6a8"/>
<svg:stop id="stop165" offset="0.34" stop-color="#fad58f"/>
<svg:stop id="stop167" offset="0.6" stop-color="#f3b966"/>
<svg:stop id="stop169" offset="0.91" stop-color="#ea942f"/>
<svg:stop id="stop171" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-left-body-gradient" x1="492.32" x2="779.73" y1="1443.45" y2="1945.83">
<svg:stop id="stop174" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop176" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop178" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop180" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop182" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerleft-spike-gradient" x1="216.71" x2="866.73" y1="709.89" y2="1889.3">
<svg:stop id="stop100" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop102" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop104" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop106" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop109" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerleft-shine-gradient" x1="1037.21" x2="393.89" y1="1809.96" y2="632.78">
<svg:stop id="stop186" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop188" offset="0.03" stop-color="#fde6a8"/>
<svg:stop id="stop190" offset="0.18" stop-color="#f7cb7e"/>
<svg:stop id="stop192" offset="0.34" stop-color="#f1b45c"/>
<svg:stop id="stop194" offset="0.5" stop-color="#eda240"/>
<svg:stop id="stop196" offset="0.66" stop-color="#ea922b"/>
<svg:stop id="stop198" offset="0.82" stop-color="#e88c1f"/>
<svg:stop id="stop200" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerright-shine-gradient" x1="963.07" x2="1633.19" y1="1805.43" y2="623.79">
<svg:stop id="stop203" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop205" offset="0.09" stop-color="#fcdd9b"/>
<svg:stop id="stop207" offset="0.3" stop-color="#f4c06f"/>
<svg:stop id="stop209" offset="0.5" stop-color="#efa74a"/>
<svg:stop id="stop211" offset="0.69" stop-color="#eb9a30"/>
<svg:stop id="stop213" offset="0.86" stop-color="#e88d21"/>
<svg:stop id="stop215" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerright-spike-gradient" x1="1784.6" x2="1132.35" y1="714.57" y2="1867.18">
<svg:stop id="stop130" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop132" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop135" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop137" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop139" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-left-base-gradient" x1="559.8" x2="994.42" y1="2062.89" y2="1925.03">
<svg:stop id="stop219" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop221" offset="0.33" stop-color="#e7841a"/>
<svg:stop id="stop223" offset="0.66" stop-color="#e57614"/>
<svg:stop id="stop225" offset="0.98" stop-color="#e66709"/>
<svg:stop id="stop227" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-right-base-gradient" x1="1413.97" x2="1014.26" y1="2049.13" y2="1928.99">
<svg:stop id="stop230" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop232" offset="0.49" stop-color="#e57614"/>
<svg:stop id="stop234" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-right-body-gradient" x1="1477.81" x2="1207.53" y1="1427.63" y2="1939.16">
<svg:stop id="stop152" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop155" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop157" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop159" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop162" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farright-spike-gradient" x1="1887.07" x2="1402.35" y1="1081.46" y2="1867.73">
<svg:stop id="stop238" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop240" offset="0.35" stop-color="#e7841a"/>
<svg:stop id="stop242" offset="0.65" stop-color="#e67c15"/>
<svg:stop id="stop244" offset="0.94" stop-color="#e6680b"/>
<svg:stop id="stop246" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farright-shine-gradient" x1="1505.66" x2="1947.3" y1="1441.41" y2="1121.28">
<svg:stop id="stop249" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop251" offset="0.1" stop-color="#fee8ab"/>
<svg:stop id="stop253" offset="0.25" stop-color="#fbd894"/>
<svg:stop id="stop255" offset="0.44" stop-color="#f5c170"/>
<svg:stop id="stop257" offset="0.64" stop-color="#eda342"/>
<svg:stop id="stop259" offset="0.79" stop-color="#e78a1c"/>
</svg:linearGradient>
</svg:defs>
<svg:rect height="2048" id="bg" style="fill:url(#bg-gradient)" width="2048"/>
<svg:path d="m 1011.0234,69.623047 c -68.68145,0.358254 -137.33366,8.122479 -204.31552,23.332073 -51.63956,11.70673 -102.27393,27.8303 -151.18861,48.09993 -60.77456,25.18495 -118.87874,56.79591 -173.05898,94.1069 -74.49388,51.25327 -141.56603,113.26838 -198.51557,183.50353 -44.86017,55.2831 -83.45784,115.65731 -114.7386,179.61972 -22.76082,46.53004 -41.6712,94.94433 -56.42893,144.59773 -0.3186,1.05737 -0.6244,2.11856 -0.93735,3.17762 -8.38861,-7.26179 -16.778716,-14.52185 -25.166012,-21.78516 89.510442,346.09941 179.022192,692.19851 268.529292,1038.29881 145.20476,25.0541 290.4088,50.1123 435.61329,75.168 132.39262,47.0988 264.78489,94.1987 397.17769,141.2969 259.4291,-255.9993 518.8573,-511.9996 778.2871,-767.9981 -10.1256,1.9097 -20.2513,3.819 -30.3769,5.7285 15.4573,-69.7034 22.9506,-141.1598 22.3427,-212.5546 -0.5288,-66.37157 -7.9614,-132.69615 -22.3642,-197.49315 -12.3952,-55.82211 -29.9176,-110.50553 -52.284,-163.13198 -21.164,-49.7799 -46.6427,-97.72274 -76.0391,-143.13011 -42.7996,-66.13677 -93.9259,-126.86171 -151.7481,-180.35876 -44.7594,-41.42978 -93.5418,-78.51142 -145.4386,-110.55643 -42.3246,-26.12866 -86.7182,-48.90934 -132.6427,-68.0153 -64.2858,-26.75145 -131.5707,-46.284592 -200.1838,-58.130618 -54.9571,-9.48842 -110.7542,-14.066273 -166.5231,-13.775505 z" id="silhouette" style="fill:none;fill-opacity:1"/>
</svg:svg>
<svg height="63%" id="emblematic-icon" preserveAspectRatio="xMidYMid meet" viewBox="0 0 640 512" width="63%" x="94.72" xmlns="http://www.w3.org/2000/svg" y="94.72">
<!--! Font Awesome Pro 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. -->
<path d="M320 0c17.7 0 32 14.3 32 32V96H472c39.8 0 72 32.2 72 72V440c0 39.8-32.2 72-72 72H168c-39.8 0-72-32.2-72-72V168c0-39.8 32.2-72 72-72H288V32c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H208zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H304zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H400zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224H64V416H48c-26.5 0-48-21.5-48-48V272c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H576V224h16z" fill="#feedb4"/>
</svg>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,16 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="SillyAssignmentJS" enabled="true" level="WEAK WARNING" enabled_by_default="true" editorAttributes="INFO_ATTRIBUTES" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
<inspection_tool class="UnnecessaryLocalVariableJS" enabled="true" level="WEAK WARNING" enabled_by_default="true" editorAttributes="INFO_ATTRIBUTES">
<option name="m_ignoreImmediatelyReturnedVariables" value="false" />
<option name="m_ignoreAnnotatedVariables" value="false" />
</inspection_tool>
</profile>
</component>

6
.idea/misc.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/royalnet.iml" filepath="$PROJECT_DIR$/royalnet.iml" />
</modules>
</component>
</project>

7
.idea/sqldialects.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/migrations/2024-07-03-231355_import_users/up.sql" dialect="PostgreSQL" />
<file url="PROJECT" dialect="PostgreSQL" />
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

BIN
.media/icon-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

194
.media/icon.svg Normal file
View file

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<svg:svg height="100%" id="emblematic-background" inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)" sodipodi:docname="bg.svg" version="1.1" viewBox="0 0 2048 2048" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview bordercolor="#ffffff" borderopacity="1" id="namedview194" inkscape:current-layer="svg" inkscape:cx="1584.6862" inkscape:cy="882.08575" inkscape:deskcolor="#505050" inkscape:pagecheckerboard="1" inkscape:pageopacity="0" inkscape:showpageshadow="0" inkscape:window-height="1019" inkscape:window-maximized="1" inkscape:window-width="1920" inkscape:window-x="1280" inkscape:window-y="32" inkscape:zoom="0.32593203" pagecolor="#505050" showgrid="false"/>
<svg:defs id="defs">
<svg:linearGradient gradientUnits="userSpaceOnUse" id="bg-gradient" x1="-16.57" x2="2100.85" y1="2168.63" y2="-160.54">
<svg:stop id="stop4" offset="0" stop-color="#e76608"/>
<svg:stop id="stop6" offset="0.11" stop-color="#ca591b"/>
<svg:stop id="stop8" offset="0.32" stop-color="#9b453c"/>
<svg:stop id="stop10" offset="0.52" stop-color="#74375b"/>
<svg:stop id="stop12" offset="0.71" stop-color="#542e6f"/>
<svg:stop id="stop14" offset="0.87" stop-color="#42277a"/>
<svg:stop id="stop16" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="orb-gradient" x1="622.07" x2="1515.79" y1="1484.77" y2="265.15">
<svg:stop id="stop19" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop21" offset="0.65" stop-color="#846895"/>
<svg:stop id="stop23" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-10-gradient" x1="91.96" x2="1726.67" y1="753.71" y2="385.42">
<svg:stop id="stop26" offset="0.08" stop-color="#ffecb3"/>
<svg:stop id="stop28" offset="0.18" stop-color="#f8e6af"/>
<svg:stop id="stop30" offset="0.32" stop-color="#e6d3a9"/>
<svg:stop id="stop32" offset="0.48" stop-color="#c7b09e"/>
<svg:stop id="stop34" offset="0.67" stop-color="#9e819a"/>
<svg:stop id="stop36" offset="0.88" stop-color="#61488b"/>
<svg:stop id="stop38" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-1-gradient" x1="540.25" x2="1436.65" y1="983.05" y2="163.09">
<svg:stop id="stop41" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop43" offset="0.13" stop-color="#edd9aa"/>
<svg:stop id="stop45" offset="0.56" stop-color="#927598"/>
<svg:stop id="stop47" offset="0.86" stop-color="#523b86"/>
<svg:stop id="stop49" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-2-gradient" x1="669.81" x2="1792.05" y1="915.19" y2="661.55">
<svg:stop id="stop52" offset="0.05" stop-color="#ffecb3"/>
<svg:stop id="stop54" offset="0.3" stop-color="#c6af9f"/>
<svg:stop id="stop56" offset="0.64" stop-color="#7d6293"/>
<svg:stop id="stop58" offset="0.88" stop-color="#4e3685"/>
<svg:stop id="stop60" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-3-gradient" x1="780.87" x2="1908.32" y1="1194.97" y2="618.21">
<svg:stop id="stop63" offset="0.08" stop-color="#ffecb3"/>
<svg:stop id="stop65" offset="0.1" stop-color="#f9e5ae"/>
<svg:stop id="stop67" offset="0.43" stop-color="#ae9199"/>
<svg:stop id="stop69" offset="0.7" stop-color="#6e558e"/>
<svg:stop id="stop71" offset="0.9" stop-color="#493283"/>
<svg:stop id="stop73" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-9-gradient" x1="-33.67" x2="1211.81" y1="227.57" y2="1240.48">
<svg:stop id="stop76" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop78" offset="0.11" stop-color="#f9e7ae"/>
<svg:stop id="stop80" offset="0.26" stop-color="#ead7ab"/>
<svg:stop id="stop82" offset="0.42" stop-color="#d1bba3"/>
<svg:stop id="stop84" offset="0.6" stop-color="#ae9199"/>
<svg:stop id="stop86" offset="0.8" stop-color="#7b5f92"/>
<svg:stop id="stop88" offset="0.99" stop-color="#3e2780"/>
<svg:stop id="stop90" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-4-gradient" x1="1977.61" x2="973.93" y1="573.35" y2="1536.48">
<svg:stop id="stop93" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop95" offset="0.1" stop-color="#f7e3ae"/>
<svg:stop id="stop97" offset="0.26" stop-color="#e3cea6"/>
<svg:stop id="stop99" offset="0.46" stop-color="#c1a89c"/>
<svg:stop id="stop101" offset="0.69" stop-color="#8e7297"/>
<svg:stop id="stop103" offset="0.94" stop-color="#4d3485"/>
<svg:stop id="stop105" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-5-gradient" x1="903.59" x2="1605.26" y1="1659.09" y2="875.65">
<svg:stop id="stop108" offset="0.14" stop-color="#ffecb3"/>
<svg:stop id="stop110" offset="0.37" stop-color="#c7af9e"/>
<svg:stop id="stop112" offset="0.67" stop-color="#7e6293"/>
<svg:stop id="stop114" offset="0.89" stop-color="#4e3685"/>
<svg:stop id="stop116" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-8-gradient" x1="190.53" x2="1148.33" y1="1319.32" y2="249.9">
<svg:stop id="stop119" offset="0.14" stop-color="#ffecb3"/>
<svg:stop id="stop121" offset="0.23" stop-color="#f7e3ae"/>
<svg:stop id="stop123" offset="0.37" stop-color="#e2cea7"/>
<svg:stop id="stop125" offset="0.54" stop-color="#c0a89d"/>
<svg:stop id="stop127" offset="0.74" stop-color="#8e7097"/>
<svg:stop id="stop129" offset="0.95" stop-color="#4b3283"/>
<svg:stop id="stop131" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-6-gradient" x1="740.45" x2="1010.63" y1="1598.17" y2="511.86">
<svg:stop id="stop134" offset="0.04" stop-color="#ffecb3"/>
<svg:stop id="stop136" offset="0.24" stop-color="#dcc7a5"/>
<svg:stop id="stop138" offset="0.69" stop-color="#806594"/>
<svg:stop id="stop140" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientUnits="userSpaceOnUse" id="star-7-gradient" x1="88.46" x2="1349.68" y1="1239.21" y2="1289.58">
<svg:stop id="stop143" offset="0.43" stop-color="#ffecb3"/>
<svg:stop id="stop145" offset="0.51" stop-color="#ecd7ab"/>
<svg:stop id="stop147" offset="0.67" stop-color="#b99f9a"/>
<svg:stop id="stop149" offset="0.9" stop-color="#61488b"/>
<svg:stop id="stop151" offset="1" stop-color="#3c247f"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farleft-spike-gradient" x1="125.6" x2="646.06" y1="1086.67" y2="2000.27">
<svg:stop id="stop154" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop156" offset="0.31" stop-color="#e77d16"/>
<svg:stop id="stop158" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farleft-shine-gradient" x1="471.9" x2="69.99" y1="1445.89" y2="1142.12">
<svg:stop id="stop161" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop163" offset="0.13" stop-color="#fde6a8"/>
<svg:stop id="stop165" offset="0.34" stop-color="#fad58f"/>
<svg:stop id="stop167" offset="0.6" stop-color="#f3b966"/>
<svg:stop id="stop169" offset="0.91" stop-color="#ea942f"/>
<svg:stop id="stop171" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-left-body-gradient" x1="492.32" x2="779.73" y1="1443.45" y2="1945.83">
<svg:stop id="stop174" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop176" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop178" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop180" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop182" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerleft-spike-gradient" x1="216.71" x2="866.73" y1="709.89" y2="1889.3">
<svg:stop id="stop100" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop102" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop104" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop106" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop109" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerleft-shine-gradient" x1="1037.21" x2="393.89" y1="1809.96" y2="632.78">
<svg:stop id="stop186" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop188" offset="0.03" stop-color="#fde6a8"/>
<svg:stop id="stop190" offset="0.18" stop-color="#f7cb7e"/>
<svg:stop id="stop192" offset="0.34" stop-color="#f1b45c"/>
<svg:stop id="stop194" offset="0.5" stop-color="#eda240"/>
<svg:stop id="stop196" offset="0.66" stop-color="#ea922b"/>
<svg:stop id="stop198" offset="0.82" stop-color="#e88c1f"/>
<svg:stop id="stop200" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerright-shine-gradient" x1="963.07" x2="1633.19" y1="1805.43" y2="623.79">
<svg:stop id="stop203" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop205" offset="0.09" stop-color="#fcdd9b"/>
<svg:stop id="stop207" offset="0.3" stop-color="#f4c06f"/>
<svg:stop id="stop209" offset="0.5" stop-color="#efa74a"/>
<svg:stop id="stop211" offset="0.69" stop-color="#eb9a30"/>
<svg:stop id="stop213" offset="0.86" stop-color="#e88d21"/>
<svg:stop id="stop215" offset="1" stop-color="#e78a1c"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-centerright-spike-gradient" x1="1784.6" x2="1132.35" y1="714.57" y2="1867.18">
<svg:stop id="stop130" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop132" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop135" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop137" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop139" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-left-base-gradient" x1="559.8" x2="994.42" y1="2062.89" y2="1925.03">
<svg:stop id="stop219" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop221" offset="0.33" stop-color="#e7841a"/>
<svg:stop id="stop223" offset="0.66" stop-color="#e57614"/>
<svg:stop id="stop225" offset="0.98" stop-color="#e66709"/>
<svg:stop id="stop227" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-right-base-gradient" x1="1413.97" x2="1014.26" y1="2049.13" y2="1928.99">
<svg:stop id="stop230" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop232" offset="0.49" stop-color="#e57614"/>
<svg:stop id="stop234" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-right-body-gradient" x1="1477.81" x2="1207.53" y1="1427.63" y2="1939.16">
<svg:stop id="stop152" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop155" offset="0.55" stop-color="#e78a1c"/>
<svg:stop id="stop157" offset="0.75" stop-color="#e77e18"/>
<svg:stop id="stop159" offset="0.89" stop-color="#e67511"/>
<svg:stop id="stop162" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farright-spike-gradient" x1="1887.07" x2="1402.35" y1="1081.46" y2="1867.73">
<svg:stop id="stop238" offset="0" stop-color="#e78a1c"/>
<svg:stop id="stop240" offset="0.35" stop-color="#e7841a"/>
<svg:stop id="stop242" offset="0.65" stop-color="#e67c15"/>
<svg:stop id="stop244" offset="0.94" stop-color="#e6680b"/>
<svg:stop id="stop246" offset="1" stop-color="#e76108"/>
</svg:linearGradient>
<svg:linearGradient gradientTransform="translate(352.3 -380.43) rotate(15)" gradientUnits="userSpaceOnUse" id="crown-farright-shine-gradient" x1="1505.66" x2="1947.3" y1="1441.41" y2="1121.28">
<svg:stop id="stop249" offset="0" stop-color="#ffecb3"/>
<svg:stop id="stop251" offset="0.1" stop-color="#fee8ab"/>
<svg:stop id="stop253" offset="0.25" stop-color="#fbd894"/>
<svg:stop id="stop255" offset="0.44" stop-color="#f5c170"/>
<svg:stop id="stop257" offset="0.64" stop-color="#eda342"/>
<svg:stop id="stop259" offset="0.79" stop-color="#e78a1c"/>
</svg:linearGradient>
</svg:defs>
<svg:rect height="2048" id="bg" style="fill:url(#bg-gradient)" width="2048"/>
<svg:path d="m 1011.0234,69.623047 c -68.68145,0.358254 -137.33366,8.122479 -204.31552,23.332073 -51.63956,11.70673 -102.27393,27.8303 -151.18861,48.09993 -60.77456,25.18495 -118.87874,56.79591 -173.05898,94.1069 -74.49388,51.25327 -141.56603,113.26838 -198.51557,183.50353 -44.86017,55.2831 -83.45784,115.65731 -114.7386,179.61972 -22.76082,46.53004 -41.6712,94.94433 -56.42893,144.59773 -0.3186,1.05737 -0.6244,2.11856 -0.93735,3.17762 -8.38861,-7.26179 -16.778716,-14.52185 -25.166012,-21.78516 89.510442,346.09941 179.022192,692.19851 268.529292,1038.29881 145.20476,25.0541 290.4088,50.1123 435.61329,75.168 132.39262,47.0988 264.78489,94.1987 397.17769,141.2969 259.4291,-255.9993 518.8573,-511.9996 778.2871,-767.9981 -10.1256,1.9097 -20.2513,3.819 -30.3769,5.7285 15.4573,-69.7034 22.9506,-141.1598 22.3427,-212.5546 -0.5288,-66.37157 -7.9614,-132.69615 -22.3642,-197.49315 -12.3952,-55.82211 -29.9176,-110.50553 -52.284,-163.13198 -21.164,-49.7799 -46.6427,-97.72274 -76.0391,-143.13011 -42.7996,-66.13677 -93.9259,-126.86171 -151.7481,-180.35876 -44.7594,-41.42978 -93.5418,-78.51142 -145.4386,-110.55643 -42.3246,-26.12866 -86.7182,-48.90934 -132.6427,-68.0153 -64.2858,-26.75145 -131.5707,-46.284592 -200.1838,-58.130618 -54.9571,-9.48842 -110.7542,-14.066273 -166.5231,-13.775505 z" id="silhouette" style="fill:none;fill-opacity:1"/>
</svg:svg>
<svg height="63%" id="emblematic-icon" preserveAspectRatio="xMidYMid meet" viewBox="0 0 640 512" width="63%" x="94.72" xmlns="http://www.w3.org/2000/svg" y="94.72">
<!--! Font Awesome Pro 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. -->
<path d="M320 0c17.7 0 32 14.3 32 32V96H472c39.8 0 72 32.2 72 72V440c0 39.8-32.2 72-72 72H168c-39.8 0-72-32.2-72-72V168c0-39.8 32.2-72 72-72H288V32c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H208zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H304zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H400zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224H64V416H48c-26.5 0-48-21.5-48-48V272c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H576V224h16z" fill="#feedb4"/>
</svg>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

1807
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

11
Cargo.toml Normal file
View file

@ -0,0 +1,11 @@
[package]
name = "royalnet"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1.0.86"
diesel = { version = "2.2.1", features = ["postgres"] }
micronfig = "0.3.0"
teloxide = "0.12.2"
tokio = { version = "1.38.0", features = ["full", "macros"] }

View file

@ -4,10 +4,34 @@
# Royalnet # Royalnet
Services network for the RYG community Fun software suite for the RYG community
</div> </div>
## History ## Quotes
See the `historic/*` branches for an archive of all the previous versions. > I can't believe I'm doing this again.
>
> --Steffo
> Come join the Ryg agenzia
>
> We have:
> - Gestione (the supercazzolone)
> - Royalnet v.n+1 BETA (will never get finished)
> - Funny gems on the national rail network
> - Amazing cron jobs
>
> --Nemesis
> comunque no prima dobbiamo fare un nuovo peggle, un nuovo rounds, un nuovo royalbot, e idk sicuramente qualcos'altro che non ricordo
>
> --Proto
> I am sorry, unknown error occured during working with your request, Admin were notified
>
> --/color
> ✅ You've received: 50 USDT ~50.00 USD from *redacted*.
>
> --telegram wallet

9
diesel.toml Normal file
View file

@ -0,0 +1,9 @@
# For documentation on how to configure this file,
# see https://diesel.rs/guides/configuring-diesel-cli
[print_schema]
file = "src/database/schema.rs"
custom_type_derives = ["diesel::query_builder::QueryId", "Clone"]
[migrations_directory]
dir = "/mnt/work/steffo/royalnet/migrations"

View file

@ -0,0 +1,6 @@
-- This file was automatically created by Diesel to setup helper functions
-- and other internal bookkeeping. This file is safe to edit, any future
-- changes will be added to existing projects as new migrations.
DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass);
DROP FUNCTION IF EXISTS diesel_set_updated_at();

View file

@ -0,0 +1,36 @@
-- This file was automatically created by Diesel to setup helper functions
-- and other internal bookkeeping. This file is safe to edit, any future
-- changes will be added to existing projects as new migrations.
-- Sets up a trigger for the given table to automatically set a column called
-- `updated_at` whenever the row is modified (unless `updated_at` was included
-- in the modified columns)
--
-- # Example
--
-- ```sql
-- CREATE TABLE users (id SERIAL PRIMARY KEY, updated_at TIMESTAMP NOT NULL DEFAULT NOW());
--
-- SELECT diesel_manage_updated_at('users');
-- ```
CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
BEGIN
EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$
BEGIN
IF (
NEW IS DISTINCT FROM OLD AND
NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at
) THEN
NEW.updated_at := current_timestamp;
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

View file

@ -0,0 +1,4 @@
DROP TABLE IF EXISTS steam;
DROP TABLE IF EXISTS discord;
DROP TABLE IF EXISTS telegram;
DROP TABLE IF EXISTS users;

View file

@ -0,0 +1,20 @@
CREATE TABLE users (
id INT PRIMARY KEY,
username VARCHAR UNIQUE NOT NULL
);
CREATE TABLE telegram (
user_id INT NOT NULL REFERENCES users (id),
telegram_id BIGINT PRIMARY KEY
);
CREATE TABLE discord (
user_id INT NOT NULL REFERENCES users (id),
discord_id BIGINT PRIMARY KEY
);
CREATE TABLE steam (
user_id INT NOT NULL REFERENCES users (id),
steam_id BIGINT PRIMARY KEY
);

View file

@ -0,0 +1,2 @@
*
!.gitignore

View file

@ -0,0 +1 @@
DROP VIEW view_ids;

View file

@ -0,0 +1,6 @@
CREATE VIEW view_ids AS
SELECT users.username, users.id, telegram.telegram_id, discord.discord_id, steam.steam_id
FROM users
JOIN telegram ON users.id = telegram.user_id
JOIN discord ON users.id = discord.user_id
JOIN steam ON users.id = steam.user_id;

12
royalnet.iml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUST_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

5
src/database/config.rs Normal file
View file

@ -0,0 +1,5 @@
use micronfig::config;
config! {
DATABASE_URL,
}

9
src/database/mod.rs Normal file
View file

@ -0,0 +1,9 @@
use diesel::{Connection, ConnectionResult, PgConnection};
pub(self) mod config;
pub mod schema;
pub mod models;
pub fn connect() -> ConnectionResult<PgConnection> {
PgConnection::establish(config::DATABASE_URL())
}

42
src/database/models.rs Normal file
View file

@ -0,0 +1,42 @@
use diesel::{Identifiable, Insertable, Queryable, Selectable};
use diesel::pg::Pg;
use super::schema::{users, telegram, discord, steam};
#[derive(Debug, Clone, Identifiable, Queryable, Selectable, Insertable)]
#[diesel(table_name = users)]
#[diesel(check_for_backend(Pg))]
pub struct RoyalnetUser {
pub id: i32,
pub username: String,
}
#[derive(Debug, Clone, Identifiable, Queryable, Selectable, Insertable)]
#[diesel(table_name = telegram)]
#[diesel(primary_key(telegram_id))]
#[diesel(check_for_backend(Pg))]
pub struct TelegramUser {
pub user_id: i32,
pub telegram_id: i64,
}
#[derive(Debug, Clone, Identifiable, Queryable, Selectable, Insertable)]
#[diesel(table_name = discord)]
#[diesel(primary_key(discord_id))]
#[diesel(check_for_backend(Pg))]
pub struct DiscordUser {
pub user_id: i32,
pub discord_id: i64,
}
#[derive(Debug, Clone, Identifiable, Queryable, Selectable, Insertable)]
#[diesel(table_name = steam)]
#[diesel(primary_key(steam_id))]
#[diesel(check_for_backend(Pg))]
pub struct SteamUser {
pub user_id: i32,
pub steam_id: i64,
}

40
src/database/schema.rs Normal file
View file

@ -0,0 +1,40 @@
// @generated automatically by Diesel CLI.
diesel::table! {
discord (discord_id) {
user_id -> Int4,
discord_id -> Int8,
}
}
diesel::table! {
steam (steam_id) {
user_id -> Int4,
steam_id -> Int8,
}
}
diesel::table! {
telegram (telegram_id) {
user_id -> Int4,
telegram_id -> Int8,
}
}
diesel::table! {
users (id) {
id -> Int4,
username -> Varchar,
}
}
diesel::joinable!(discord -> users (user_id));
diesel::joinable!(steam -> users (user_id));
diesel::joinable!(telegram -> users (user_id));
diesel::allow_tables_to_appear_in_same_query!(
discord,
steam,
telegram,
users,
);

35
src/main.rs Normal file
View file

@ -0,0 +1,35 @@
use anyhow::{Context, Result};
mod database;
mod telegram;
#[tokio::main]
async fn main() -> Result<()> {
let mut tg = telegram::connect();
teloxide::repl(tg, |tg: teloxide::Bot, msg: teloxide::types::Message| async move {
use teloxide::prelude::*;
let mut db = database::connect()
.expect("Failed to connect to the database");
let whoami = {
use diesel::prelude::*;
use database::schema::telegram::dsl::*;
use database::models::*;
telegram
.filter(telegram_id.eq(msg.chat.id.0))
.limit(1)
.select(TelegramUser::as_select())
.load(&mut db)
.expect("Failed to query")
.pop()
.expect("Failed to get object")
};
tg.send_message(msg.chat.id, format!("{whoami:?}")).await?;
Ok(())
}).await;
Ok(())
}

5
src/telegram/config.rs Normal file
View file

@ -0,0 +1,5 @@
use micronfig::config;
config! {
TELEGRAM_BOT_TOKEN,
}

7
src/telegram/mod.rs Normal file
View file

@ -0,0 +1,7 @@
use teloxide::Bot;
mod config;
pub fn connect() -> Bot {
Bot::new(config::TELEGRAM_BOT_TOKEN())
}