Initial project structure and core modules

Add environment example, update .gitignore, and switch license to AGPL v3. Introduce error handling classes, ESLint config, and main modules for database, logging, certificate management, and utility functions. Add authentication routes, schemas, and service layer for a modular REST API. Update README and set up repository structure for further development.
This commit is contained in:
2025-12-23 15:59:43 +01:00
parent 4e822b4868
commit 0b1662d8ca
32 changed files with 4656 additions and 88 deletions
+29
View File
@@ -0,0 +1,29 @@
const path = require("node:path")
const Logger = require("./logger")
const logger = Logger.createLogger(path.join(__dirname, ".."))
async function getRegistrationCountryFromIp(ipAddress) {
const apiUrl = `https://ip-api.com/json/${ipAddress}?fields=countryCode`
try {
const response = await fetch(apiUrl)
if (!response.ok) {
return "FR"
}
const data = await response.json()
if (data && data.countryCode) {
const countryCode = data.countryCode
return countryCode
} else {
return "FR"
}
} catch (error) {
return "??"
}
}
module.exports = {
getRegistrationCountryFromIp
}