Compare commits
2 Commits
e15664e39a
...
0a402ea21a
Author | SHA1 | Date | |
---|---|---|---|
0a402ea21a | |||
2b13681334 |
@ -1,33 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "pyrss-ng",
|
"name": "pyrss-ng",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "",
|
"main": "src/app.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"tailwind": "npx tailwindcss -i ./src/client/public/css/main.css -o ./src/client/public/css/tailwind.css",
|
||||||
|
"dev": "npm run tailwind && nodemon src/app.js",
|
||||||
|
"start": "node src/app.js"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea.cor.bz/corbz/pyrss-ng.git"
|
"url": "https://gitea.cor.bz/corbz/pyrss-ng.git"
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
|
||||||
"author": "",
|
"author": "",
|
||||||
"type": "commonjs",
|
"license": "ISC",
|
||||||
"main": "index.js",
|
"description": "",
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"start": "node index.js",
|
|
||||||
"dev": "nodemon index.js"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"connect-flash": "^0.1.1",
|
"dotenv": "^16.4.7",
|
||||||
"discord.js": "^14.17.3",
|
|
||||||
"ejs": "^3.1.10",
|
"ejs": "^3.1.10",
|
||||||
"ejs-blocks": "^0.1.4",
|
"ejs-mate": "^4.0.0",
|
||||||
"express": "^4.21.2",
|
"express": "^4.21.2",
|
||||||
"express-fileupload": "^1.5.1",
|
"preline": "^2.7.0"
|
||||||
"express-session": "^1.18.1",
|
|
||||||
"lolcatjs": "^2.4.3",
|
|
||||||
"socket.io": "^4.8.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^9.18.0",
|
"nodemon": "^3.1.9",
|
||||||
"nodemon": "^3.1.9"
|
"tailwindcss": "^3.4.17"
|
||||||
}
|
}
|
||||||
}
|
}
|
26
src/app.js
Normal file
26
src/app.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
const express = require("express");
|
||||||
|
const engine = require("ejs-mate");
|
||||||
|
const dotenv = require("dotenv");
|
||||||
|
|
||||||
|
// import routers
|
||||||
|
const homeRouter = require("./server/routes/home");
|
||||||
|
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
app.engine("ejs", engine);
|
||||||
|
app.set("views", __dirname + "/client/views");
|
||||||
|
app.set("view engine", "ejs");
|
||||||
|
|
||||||
|
app.use("/static", express.static(__dirname + "/client/public"));
|
||||||
|
app.use("/static/preline.js", express.static(__dirname + "/../node_modules/preline/dist/preline.js"));
|
||||||
|
|
||||||
|
// register routers
|
||||||
|
app.use("/", homeRouter);
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`Server is listening on http://localhost:${PORT}`);
|
||||||
|
});
|
24
src/bot.js
24
src/bot.js
@ -1,24 +0,0 @@
|
|||||||
const discord = require("discord.js");
|
|
||||||
const fileSystem = require("fs");
|
|
||||||
|
|
||||||
// const { GatewayIntentBits } = require("discord.js");
|
|
||||||
|
|
||||||
const client = new discord.Client({
|
|
||||||
intents: []
|
|
||||||
});
|
|
||||||
|
|
||||||
const config = require("./config/config.json");
|
|
||||||
client.config = config;
|
|
||||||
|
|
||||||
fileSystem.readdir("./events/", (error, files) => {
|
|
||||||
if (error) { return console.error(error); }
|
|
||||||
files.forEach(file => {
|
|
||||||
const event = require (`./events/${file}`);
|
|
||||||
const eventName = file.split(".")[0];
|
|
||||||
client.on(eventName, event.bind(null, client));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
client.login(config.token);
|
|
||||||
|
|
||||||
exports.client = client;
|
|
13
src/client/public/css/main.css
Normal file
13
src/client/public/css/main.css
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
/* flex items-center gap-x-3.5 py-2 px-2.5 bg-gray-100 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:bg-neutral-700 dark:text-white
|
||||||
|
hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:text-neutral-200 */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-btn {
|
||||||
|
@apply flex items-center gap-x-3.5 py-2 px-2.5 text-sm rounded-lg focus:outline-none text-gray-800 hover:bg-gray-100 focus:bg-gray-100 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 dark:text-neutral-200;
|
||||||
|
}
|
1970
src/client/public/css/tailwind.css
Normal file
1970
src/client/public/css/tailwind.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/client/public/images/pyrss_logo.webp
Normal file
BIN
src/client/public/images/pyrss_logo.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
3
src/client/views/home.ejs
Normal file
3
src/client/views/home.ejs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<% layout("layout") -%>
|
||||||
|
|
||||||
|
test
|
374
src/client/views/layout.ejs
Normal file
374
src/client/views/layout.ejs
Normal file
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
|||||||
const chalk = require("chalk");
|
|
||||||
const config = require("../config/config.json")
|
|
||||||
require("../bot");
|
|
||||||
|
|
||||||
module.exports = client => {
|
|
||||||
// console.clear();
|
|
||||||
|
|
||||||
console.log(chalk.bold.green("Launched Successfully...\n"));
|
|
||||||
console.log(chalk.magenta("Version:"), chalk.cyan("-"));
|
|
||||||
console.log(chalk.magenta("Made by"), chalk.cyan("Corbz"));
|
|
||||||
console.log(chalk.magenta("Prefix:"), chalk.cyan(`${config.prefix}\n`));
|
|
||||||
|
|
||||||
if (client.user) {
|
|
||||||
console.log(chalk.green(chalk.bold(client.user.username), "is online!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(chalk.green("website:", chalk.underline(`http://localhost:${config.port}`)));
|
|
||||||
};
|
|
48
src/index.js
48
src/index.js
@ -1,48 +0,0 @@
|
|||||||
const discord = require("./bot");
|
|
||||||
const express = require("express");
|
|
||||||
const engine = require("ejs-blocks");
|
|
||||||
const session = require("express-session");
|
|
||||||
const flash = require("connect-flash");
|
|
||||||
const fileUpload = require("express-fileupload");
|
|
||||||
const config = require("./config/config.json");
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
const http = require("http").Server(app);
|
|
||||||
const io = require("socket.io")(http);
|
|
||||||
|
|
||||||
port = config.port;
|
|
||||||
|
|
||||||
app.use(express.static("./public"));
|
|
||||||
app.use(express.static("./themes"));
|
|
||||||
app.engine("ejs", engine);
|
|
||||||
app.set("view engine", "ejs");
|
|
||||||
app.use(express.urlencoded({ extended: true, limit: "5mb" }));
|
|
||||||
app.use(fileUpload());
|
|
||||||
|
|
||||||
app.use(
|
|
||||||
session({
|
|
||||||
secret: "test",
|
|
||||||
resave: true,
|
|
||||||
saveUninitialized: true
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
app.use(flash());
|
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
|
||||||
res.locals.success = req.flash("success"),
|
|
||||||
res.locals.error = req.flash("error");
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use("/", require("./routes/home.js"));
|
|
||||||
|
|
||||||
http.listen(port);
|
|
||||||
|
|
||||||
// io.sockets.on("connection", sockets => {
|
|
||||||
|
|
||||||
// });
|
|
||||||
|
|
||||||
app.use((req, res) => {
|
|
||||||
res.status(404).render("error_pages/404");
|
|
||||||
});
|
|
@ -1,14 +0,0 @@
|
|||||||
const express = require("express");
|
|
||||||
const router = express.Router();
|
|
||||||
|
|
||||||
router.get("/", (request, response) => {
|
|
||||||
response.redirect("/home");
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/home", (request, response) => {
|
|
||||||
response.render("home/home", {
|
|
||||||
title: "pyrss-ng · home",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = router;
|
|
6
src/server/controllers/home.js
Normal file
6
src/server/controllers/home.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
const get = async (request, response) => {
|
||||||
|
response.render("home", {title: "home page"});
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { get };
|
9
src/server/routes/home.js
Normal file
9
src/server/routes/home.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
const { Router } = require("express");
|
||||||
|
const controller = require("../controllers/home");
|
||||||
|
|
||||||
|
const router = Router();
|
||||||
|
|
||||||
|
router.get("/", controller.get);
|
||||||
|
|
||||||
|
module.exports = router;
|
@ -1,2 +0,0 @@
|
|||||||
<%- layout("../layout") %>
|
|
||||||
hello world
|
|
@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf=8">
|
|
||||||
<title><%- title %></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
start
|
|
||||||
<%- body %>
|
|
||||||
end
|
|
||||||
</body>
|
|
||||||
</html>
|
|
12
tailwind.config.js
Normal file
12
tailwind.config.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: [
|
||||||
|
"./src/client/**/*.{html,js,ejs}",
|
||||||
|
"./node_modules/preline/dist/*.js"
|
||||||
|
],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [require('preline/plugin')],
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user