README & License
This commit is contained in:
		
							parent
							
								
									37c1cfd46f
								
							
						
					
					
						commit
						6dd6f41f8c
					
				| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
# The MIT License (MIT)
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2015-2022 Vladimir Iakovlev
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
in the Software without restriction, including without limitation the rights
 | 
			
		||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
furnished to do so, subject to the following conditions:
 | 
			
		||||
 | 
			
		||||
The above copyright notice and this permission notice shall be included in
 | 
			
		||||
all copies or substantial portions of the Software.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
			
		||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
THE SOFTWARE.
 | 
			
		||||
							
								
								
									
										12
									
								
								README.md
								
								
								
								
							
							
						
						
									
										12
									
								
								README.md
								
								
								
								
							| 
						 | 
				
			
			@ -12,6 +12,7 @@ Willkommen auf meiner persönlichen Website! Diese Seite dient als Plattform, um
 | 
			
		|||
### 2. **Login-Funktion**
 | 
			
		||||
 | 
			
		||||
- Registrierte Nutzer können sich einloggen, um Zugriff auf erweiterte Funktionen zu erhalten.
 | 
			
		||||
- Die Selbstregistrierung ist nicht Möglich, neue Nutzer müssen durch einen Admin erstellt werden.
 | 
			
		||||
- Sicherheit wird durch eine sichere Passwortspeicherung und Authentifizierung gewährleistet.
 | 
			
		||||
 | 
			
		||||
### 3. **QR-Code Generator (für angemeldete Nutzer)**
 | 
			
		||||
| 
						 | 
				
			
			@ -49,12 +50,7 @@ Willkommen auf meiner persönlichen Website! Diese Seite dient als Plattform, um
 | 
			
		|||
 | 
			
		||||
3. Konfiguriere die Umgebungsvariablen:
 | 
			
		||||
 | 
			
		||||
   - Erstelle eine `.env` Datei im Hauptverzeichnis und füge die folgenden Variablen hinzu:
 | 
			
		||||
 | 
			
		||||
   ```plaintext
 | 
			
		||||
   TELEGRAM_BOT_TOKEN=your-telegram-bot-token
 | 
			
		||||
   TELEGRAM_CHAT_ID=your-telegram-chat-id
 | 
			
		||||
   ```
 | 
			
		||||
   - Benenne `.env_default` in `.env` um und fülle die Variablen aus
 | 
			
		||||
 | 
			
		||||
4. Starte die Anwendung:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -76,9 +72,9 @@ Die Kontaktseite ist über einen QR-Code zugänglich, der sich im Auto befindet.
 | 
			
		|||
 | 
			
		||||
## Technologie-Stack
 | 
			
		||||
 | 
			
		||||
- **Backend:** Node.js, Express
 | 
			
		||||
- **Backend:** Node.js, Express, postgresql
 | 
			
		||||
- **Frontend:** EJS, Bootstrap
 | 
			
		||||
- **Authentifizierung:** Passport.js
 | 
			
		||||
- **Authentifizierung:** Bcrypt
 | 
			
		||||
- **QR-Code-Generierung:** `qrcode` npm-Paket
 | 
			
		||||
- **Benachrichtigungen:** Telegram Bot API
 | 
			
		||||
- **Hosting:** Kann auf jedem Node.js-fähigen Server betrieben werden
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										6
									
								
								app.js
								
								
								
								
							
							
						
						
									
										6
									
								
								app.js
								
								
								
								
							| 
						 | 
				
			
			@ -6,7 +6,7 @@ const nodemailer = require("nodemailer");
 | 
			
		|||
const { Pool } = require("pg");
 | 
			
		||||
const path = require("path");
 | 
			
		||||
const moment = require("moment");
 | 
			
		||||
const marked = require("marked");
 | 
			
		||||
const { marked } = require("marked");
 | 
			
		||||
const axios = require("axios");
 | 
			
		||||
require("dotenv").config();
 | 
			
		||||
const log = require("node-file-logger");
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ bot.on("text", (msg) => {
 | 
			
		|||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
bot.start();
 | 
			
		||||
//bot.start();
 | 
			
		||||
 | 
			
		||||
const options = {
 | 
			
		||||
  folderPath: "./logs/",
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +144,6 @@ app.post("/login", async (req, res) => {
 | 
			
		|||
          req.session.activeRiege = 1;
 | 
			
		||||
          req.session.activeTab = "geraete";
 | 
			
		||||
          req.session.message = [(title = ""), (message = ""), (type = "none")];
 | 
			
		||||
          log.Info(username + " " + password);
 | 
			
		||||
          if (user.admin_status === "expired") {
 | 
			
		||||
            await pool.query(
 | 
			
		||||
              "UPDATE users SET role = $1, admin_temp = NULL WHERE id = $2",
 | 
			
		||||
| 
						 | 
				
			
			@ -416,7 +415,6 @@ app.get("/project/:id", async (req, res) => {
 | 
			
		|||
 | 
			
		||||
    // Abrufen der Datei
 | 
			
		||||
    const response = await axios.get(url);
 | 
			
		||||
    console.log(response.data);
 | 
			
		||||
    // Markdown-Inhalt in HTML umwandeln
 | 
			
		||||
    const htmlContent = marked(response.data);
 | 
			
		||||
    //const htmlContent = "Testdata";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@
 | 
			
		|||
<div id="view" class="mt-5">
 | 
			
		||||
  <h1><%= projekt.name %></h1>
 | 
			
		||||
  <p><%= projekt.kurzbeschreibung %></p>
 | 
			
		||||
  <p><%= content %></p>
 | 
			
		||||
  <p><%- content %></p>
 | 
			
		||||
  <p>
 | 
			
		||||
    <a href="<%= projekt.repository_link %>" target="_blank">Repository Link</a>
 | 
			
		||||
  </p>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue