Skip to content

Commit 199c02b

Browse files
committed
Init
0 parents  commit 199c02b

File tree

11 files changed

+621
-0
lines changed

11 files changed

+621
-0
lines changed

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
6+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
7+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
8+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
9+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
10+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
11+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
12+
POSSIBILITY OF SUCH DAMAGE.
13+
14+
Copyright (c) 2023-2025 SyNdicate Foundation
15+
16+
this software is free of charge, and the access to the source code is gladly provided.
17+
forking this software, making private copies of this software, is completly acceptable, however
18+
making public copies, without authors permission & selling this software, is NOT acceptable.
19+
any damage caused by this software is ONLY a issue by USER! not OWNER!

assets/templates/colleagues.html

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Our Colleagues - SyNdicateFoundation</title>
7+
<script src="https://cdn.tailwindcss.com"></script>
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9+
<link rel="stylesheet" href="common.css">
10+
</head>
11+
<body class="min-h-screen flex flex-col gradient-bg">
12+
<header class="bg-gray-800 text-gray-300 shadow-lg">
13+
<div class="container mx-auto px-4 py-6">
14+
<div class="flex flex-col md:flex-row justify-between items-center">
15+
<div class="flex items-center mb-4 md:mb-0">
16+
<img src="/assets/logo.png" alt="Logo" class="h-10 w-10 rounded-full mr-2">
17+
<h1 class="text-3xl font-bold">SyNdicate Foundation</h1>
18+
</div>
19+
<nav class="flex space-x-1 md:space-x-6">
20+
<a href="/assets/templates/index.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium transition-colors">Home</a>
21+
<a href="/assets/templates/projects.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium transition-colors">Projects</a>
22+
<a href="/assets/templates/members.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium transition-colors">Members</a>
23+
<a href="/assets/templates/technologies.html" class="nav-link px-3 py-2 rounded-md text-sm font-medium transition-colors">Technologies</a>
24+
<a href="#end" class="nav-link px-3 py-2 rounded-md text-sm font-medium transition-colors">Contact Us</a>
25+
</nav>
26+
</div>
27+
</div>
28+
</header>
29+
30+
<main class="flex-grow container mx-auto px-4 md:px-6 py-12">
31+
<div class="text-center mb-12">
32+
<h1 class="text-4xl md:text-5xl font-bold mb-4 gradient-text text-gray-300">Our Colleagues</h1>
33+
<p class="text-lg text-gray-400 max-w-2xl mx-auto">Collaborating with innovative partners to build the future together</p>
34+
</div>
35+
36+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
37+
<div class="gradient-bg rounded-xl overflow-hidden border border-gray-700 card-hover">
38+
<div class="p-6">
39+
<div class="flex items-center space-x-4 mb-4">
40+
<div class="w-14 h-14 rounded-full gradient-bg from-blue-500 to-purple-600 flex items-center justify-center">
41+
<span class="text-gray-300 text-xl font-bold">LD</span>
42+
</div>
43+
<div>
44+
<h3 class="text-xl font-bold text-gray-300">LiteDeforged</h3>
45+
<p class="text-gray-400">Strategic Partner</p>
46+
</div>
47+
</div>
48+
<p class="text-gray-300 mb-6">Join our fresh gaming community and have fun!</p>
49+
<a href="https://discord.gg/93JMcTy5PQ" target="_blank" class="inline-flex items-center px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-gray-300 rounded-lg transition duration-200">
50+
<i class="fab fa-discord mr-2"></i> Join Discord
51+
</a>
52+
</div>
53+
</div>
54+
</div>
55+
56+
<div class="mt-12 text-center">
57+
<p class="text-gray-400">Currently, we have 1 colleague.</p>
58+
</div>
59+
</main>
60+
61+
<footer id="end" class="bg-gray-800 text-gray-300 py-8">
62+
<div class="container mx-auto px-4">
63+
<div class="flex flex-col md:flex-row justify-between items-center">
64+
<div class="mb-4 md:mb-0">
65+
<p class="text-sm">
66+
Powered by <span class="font-bold">SyNdicate Foundation</span> & Contributors with <i class="fas fa-heart text-red-400"></i>
67+
</p>
68+
<p class="text-xs text-gray-400 mt-1">Happy coding! <i class="far fa-smile-wink"></i></p>
69+
</div>
70+
71+
<div class="flex space-x-4">
72+
<a href="https://github.com/SyNdicateFoundation" class="text-gray-400 hover:text-gray-300 transition">
73+
<i class="fab fa-github fa-lg"></i>
74+
</a>
75+
<a href="https://discord.gg/e7mn6uuCmy" class="text-gray-400 hover:text-gray-300 transition">
76+
<i class="fab fa-discord fa-lg"></i>
77+
</a>
78+
<a href="https://t.me/SyNdicateFoundation_IR" class="text-gray-400 hover:text-gray-300 transition">
79+
<i class="fab fa-telegram fa-lg"></i>
80+
</a>
81+
<a href="mailto:[email protected]" class="text-gray-400 hover:text-gray-300 transition">
82+
<i class="fas fa-envelope fa-lg"></i>
83+
</a>
84+
</div>
85+
86+
<div class="text-sm text-gray-400">
87+
<p>[12/31/2023 - 1402/11/10] 3:05 PM IRST (Asia/Tehran)</p>
88+
<p class="mt-1">Sourcecode licenses may apply</p>
89+
</div>
90+
</div>
91+
</div>
92+
</footer>
93+
94+
</body>
95+
</html>

common/command.go

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package command
2+
3+
import (
4+
"SyNdicateBackend/common/logger"
5+
"bufio"
6+
"github.com/muesli/termenv"
7+
"os"
8+
)
9+
10+
type Command struct {
11+
Name string
12+
Description string
13+
Handler func(t *termenv.Output)
14+
}
15+
16+
var (
17+
scanner = bufio.NewScanner(os.Stdin)
18+
Commands = map[string]Command{
19+
"clear": {
20+
Name: "clear",
21+
Description: "Clear the screen",
22+
Handler: func(t *termenv.Output) {
23+
t.ClearScreen()
24+
},
25+
},
26+
"help": {
27+
Name: "help",
28+
Description: "Show this help message",
29+
Handler: func(t *termenv.Output) {
30+
31+
},
32+
},
33+
"exit": {
34+
Name: "exit",
35+
Description: "Exits the TELNET session",
36+
Handler: func(t *termenv.Output) {
37+
logger.Logger.Info("Bye!")
38+
os.Exit(1)
39+
},
40+
},
41+
}
42+
)
43+
44+
func readInput() string {
45+
scanner.Scan()
46+
return scanner.Text()
47+
}
48+
func HandleCommand(commandName string, terminal *termenv.Output) {
49+
50+
if command, ok := Commands[commandName]; ok {
51+
command.Handler(terminal)
52+
53+
} else {
54+
logger.Logger.Error("Unknown Command")
55+
}
56+
}
57+
58+
func Loop(terminal *termenv.Output) {
59+
for {
60+
HandleCommand(readInput(), terminal)
61+
}
62+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package configuration
2+
3+
import (
4+
"SyNdicateBackend/common/logger"
5+
"github.com/BurntSushi/toml"
6+
"os"
7+
)
8+
9+
// HTTPSServer -------------- HTTPS config holders --------------
10+
type HTTPSServer struct {
11+
Enabled bool `toml:"enabled"`
12+
Address string `toml:"address"`
13+
Port int `toml:"port"`
14+
APIUserAgent string `toml:"api_user_agent"`
15+
TlsConfiguration HttpsTlsConfiguration `toml:"tls_configuration"`
16+
}
17+
type HttpsTlsConfiguration struct {
18+
Enable bool `toml:"enable"`
19+
CertFile string `toml:"cert_file"`
20+
KeyFile string `toml:"key_file"`
21+
}
22+
23+
// SQLLiteConfiguration -------------- SQLLite config holders --------------
24+
type SQLLiteConfiguration struct {
25+
DatabaseFileLocation string `toml:"file_location"`
26+
}
27+
28+
type Tokenizer struct {
29+
TokenizerSecret string `toml:"tokenizer_secret"`
30+
TokenExpiration int `toml:"token_expiration"`
31+
}
32+
33+
type Holder struct {
34+
debug bool `toml:"debug"`
35+
HTTPSServer HTTPSServer `toml:"https_server"`
36+
SQLLiteConfiguration SQLLiteConfiguration `toml:"database"`
37+
Tokenizer Tokenizer `toml:"tokenizer"`
38+
}
39+
40+
var ConfigHolder Holder
41+
42+
func SetupConfig() {
43+
if _, err := os.Stat("config.toml"); os.IsNotExist(err) {
44+
ConfigHolder = Holder{
45+
debug: false,
46+
HTTPSServer: HTTPSServer{
47+
Enabled: true,
48+
Address: "0.0.0.0",
49+
Port: 2009,
50+
APIUserAgent: "LiteGuard Client 1.0/b (Software)",
51+
TlsConfiguration: HttpsTlsConfiguration{
52+
Enable: false,
53+
CertFile: "cert.pem",
54+
KeyFile: "key.pem",
55+
},
56+
},
57+
SQLLiteConfiguration: SQLLiteConfiguration{
58+
DatabaseFileLocation: "database.db",
59+
},
60+
Tokenizer: Tokenizer{
61+
TokenizerSecret: "TBJU8H91IEJu7g/fygTjEKM5kBx8qiDdTouuMmYQd3jlAt62Jmwq/3X7S1nmgcsE",
62+
TokenExpiration: 10,
63+
},
64+
}
65+
file, err := os.Create("config.toml")
66+
if err != nil {
67+
logger.Logger.Error(err)
68+
}
69+
defer func(file *os.File) {
70+
71+
if err := file.Close(); err != nil {
72+
logger.Logger.Error(err)
73+
}
74+
}(file)
75+
76+
encoder := toml.NewEncoder(file)
77+
if err := encoder.Encode(ConfigHolder); err != nil {
78+
logger.Logger.Error(err)
79+
}
80+
}
81+
82+
if _, err := toml.DecodeFile("config.toml", &ConfigHolder); err != nil {
83+
logger.Logger.Error(err)
84+
}
85+
}

common/logger/logger.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package logger
2+
3+
import (
4+
"fmt"
5+
"github.com/sirupsen/logrus"
6+
)
7+
8+
var Logger *logrus.Logger
9+
10+
func SetupLogger() {
11+
Logger = logrus.New()
12+
Logger.SetFormatter(&customFormat{})
13+
Logger.SetLevel(logrus.DebugLevel)
14+
}
15+
16+
type customFormat struct{}
17+
18+
func (F *customFormat) Format(ent *logrus.Entry) ([]byte, error) {
19+
return []byte(fmt.Sprintf("[SyNdicateBackend] [%s] %s\n", ent.Level.String(), ent.Message)), nil
20+
}

go.mod

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module SyNdicateBackend
2+
3+
go 1.24
4+
5+
require (
6+
github.com/BurntSushi/toml v1.5.0
7+
github.com/gin-gonic/gin v1.10.1
8+
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021
9+
github.com/muesli/termenv v0.16.0
10+
github.com/sirupsen/logrus v1.9.3
11+
)
12+
13+
require (
14+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
15+
github.com/bytedance/sonic v1.11.6 // indirect
16+
github.com/bytedance/sonic/loader v0.1.1 // indirect
17+
github.com/cloudwego/base64x v0.1.4 // indirect
18+
github.com/cloudwego/iasm v0.2.0 // indirect
19+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
20+
github.com/gin-contrib/sse v0.1.0 // indirect
21+
github.com/go-playground/locales v0.14.1 // indirect
22+
github.com/go-playground/universal-translator v0.18.1 // indirect
23+
github.com/go-playground/validator/v10 v10.20.0 // indirect
24+
github.com/goccy/go-json v0.10.2 // indirect
25+
github.com/google/go-cmp v0.6.0 // indirect
26+
github.com/json-iterator/go v1.1.12 // indirect
27+
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
28+
github.com/kr/pretty v0.1.0 // indirect
29+
github.com/leodido/go-urn v1.4.0 // indirect
30+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
31+
github.com/mattn/go-isatty v0.0.20 // indirect
32+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
33+
github.com/modern-go/reflect2 v1.0.2 // indirect
34+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
35+
github.com/rivo/uniseg v0.4.7 // indirect
36+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
37+
github.com/ugorji/go/codec v1.2.12 // indirect
38+
golang.org/x/arch v0.8.0 // indirect
39+
golang.org/x/crypto v0.23.0 // indirect
40+
golang.org/x/net v0.25.0 // indirect
41+
golang.org/x/sys v0.30.0 // indirect
42+
golang.org/x/text v0.15.0 // indirect
43+
google.golang.org/protobuf v1.34.1 // indirect
44+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
45+
gopkg.in/yaml.v3 v3.0.1 // indirect
46+
)

0 commit comments

Comments
 (0)