Initial project structure and core files

Add base project files including environment example, license, README, .gitignore, error classes, ESLint config, database modules, texture assets, repositories, routes, schemas, services, and server entry point. This establishes the foundational structure for a Yggdrasil-compatible REST API with modular error handling, database setup, and route organization.
This commit is contained in:
2026-01-05 04:42:39 +01:00
commit 587146d322
112 changed files with 8540 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
const express = require("express")
const router = express.Router()
const utils = require("../../../modules/utils") // Pour addDashesToUUID
const authService = require("../../../services/authService")
const userService = require("../../../services/userService")
router.get("/", async (req, res, next) => {
const user = await authService.verifyUserFromHeader(req.headers.authorization)
const result = await userService.getBlockedUuids(user.uuid)
return res.status(200).json({
blockedProfiles: result.data || []
})
})
router.put("/:uuid", async (req, res, next) => {
const user = await authService.verifyUserFromHeader(req.headers.authorization)
const targetUuid = utils.addDashesToUUID(req.params.uuid)
await userService.blockPlayer(user.uuid, targetUuid)
const result = await userService.getBlockedUuids(user.uuid)
return res.status(200).json({
blockedProfiles: result.data || []
})
})
router.delete("/:uuid", async (req, res, next) => {
const user = await authService.verifyUserFromHeader(req.headers.authorization)
const targetUuid = utils.addDashesToUUID(req.params.uuid)
await userService.unblockPlayer(user.uuid, targetUuid)
const result = await userService.getBlockedUuids(user.uuid)
return res.status(200).json({
blockedProfiles: result.data || []
})
})
module.exports = router