refactor: rename project to MedAssist-ng and update configurations

- Updated environment variables in .env.example for production setup.
- Changed project references from MedAssist to MedAssist-ng in documentation and code.
- Adjusted Docker configurations for new image names and ports.
- Removed deprecated push-images.sh script and added docker-compose.dev.yml for development.
- Updated translation files to reflect new project name.
- Ensured all email notifications and headers reflect the new branding.
This commit is contained in:
Daniel Volz
2025-12-24 13:01:53 +01:00
parent c5e03a787d
commit 738513a3ba
24 changed files with 254 additions and 374 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import dotenv from "dotenv";
dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
const url = process.env.DATABASE_URL || "file:./data/medassist.db";
const url = process.env.DATABASE_URL || "file:./data/medassist-ng.db";
// Ensure data directory exists before creating database
if (url.startsWith("file:")) {
+1 -1
View File
@@ -3,7 +3,7 @@ import dotenv from "dotenv";
dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
const url = process.env.DATABASE_URL || "file:./data/medassist.db";
const url = process.env.DATABASE_URL || "file:./data/medassist-ng.db";
async function main() {
console.log("Starting database setup...");
+16 -16
View File
@@ -54,8 +54,8 @@ type TranslationKeys = {
const translations: Record<Language, TranslationKeys> = {
en: {
stockReminder: {
subject: "MedAssist Auto-Reminder: {count} Medication{s} Running Low",
title: "⚠️ MedAssist - Automatic Reorder Reminder",
subject: "MedAssist-ng Auto-Reminder: {count} Medication{s} Running Low",
title: "⚠️ MedAssist-ng - Automatic Reorder Reminder",
description: "The following medications are running low and need to be reordered:",
alertSingle: "⚠️ 1 medication running low!",
alertMultiple: "⚠️ {count} medications running low!",
@@ -65,11 +65,11 @@ const translations: Record<Language, TranslationKeys> = {
days: "Days",
runsOut: "Runs Out",
},
footer: "🤖 Automatic reminder from MedAssist",
footer: "🤖 Automatic reminder from MedAssist-ng",
},
intakeReminder: {
subject: "MedAssist: Medication Reminder - {medications}",
title: "💊 MedAssist - Intake Reminder",
subject: "MedAssist-ng: Medication Reminder - {medications}",
title: "💊 MedAssist-ng - Intake Reminder",
description: "Time to take your medication in {minutes} minutes:",
alertSingle: "💊 1 medication scheduled",
alertMultiple: "💊 {count} medications scheduled",
@@ -79,11 +79,11 @@ const translations: Record<Language, TranslationKeys> = {
time: "Time",
},
pills: "pills",
footer: "MedAssist Medication Planner",
footer: "MedAssist-ng Medication Planner",
},
push: {
stockTitle: "MedAssist: 1 Medication Running Low",
stockTitleMultiple: "MedAssist: {count} Medications Running Low",
stockTitle: "MedAssist-ng: 1 Medication Running Low",
stockTitleMultiple: "MedAssist-ng: {count} Medications Running Low",
intakeTitle: "Medication Reminder in {minutes} min",
pillsLeft: "{count} pills",
daysLeft: "{count} days left",
@@ -99,8 +99,8 @@ const translations: Record<Language, TranslationKeys> = {
},
de: {
stockReminder: {
subject: "MedAssist Auto-Erinnerung: {count} Medikament{e} wird knapp",
title: "⚠️ MedAssist - Automatische Nachbestell-Erinnerung",
subject: "MedAssist-ng Auto-Erinnerung: {count} Medikament{e} wird knapp",
title: "⚠️ MedAssist-ng - Automatische Nachbestell-Erinnerung",
description: "Die folgenden Medikamente gehen zur Neige und sollten nachbestellt werden:",
alertSingle: "⚠️ 1 Medikament wird knapp!",
alertMultiple: "⚠️ {count} Medikamente werden knapp!",
@@ -110,11 +110,11 @@ const translations: Record<Language, TranslationKeys> = {
days: "Tage",
runsOut: "Aufgebraucht",
},
footer: "🤖 Automatische Erinnerung von MedAssist",
footer: "🤖 Automatische Erinnerung von MedAssist-ng",
},
intakeReminder: {
subject: "MedAssist: Einnahme-Erinnerung - {medications}",
title: "💊 MedAssist - Einnahme-Erinnerung",
subject: "MedAssist-ng: Einnahme-Erinnerung - {medications}",
title: "💊 MedAssist-ng - Einnahme-Erinnerung",
description: "Zeit für Ihre Medikamente in {minutes} Minuten:",
alertSingle: "💊 1 Medikament geplant",
alertMultiple: "💊 {count} Medikamente geplant",
@@ -124,11 +124,11 @@ const translations: Record<Language, TranslationKeys> = {
time: "Uhrzeit",
},
pills: "Tabletten",
footer: "MedAssist Medikamentenplaner",
footer: "MedAssist-ng Medikamentenplaner",
},
push: {
stockTitle: "MedAssist: 1 Medikament wird knapp",
stockTitleMultiple: "MedAssist: {count} Medikamente werden knapp",
stockTitle: "MedAssist-ng: 1 Medikament wird knapp",
stockTitleMultiple: "MedAssist-ng: {count} Medikamente werden knapp",
intakeTitle: "Einnahme-Erinnerung in {minutes} Min.",
pillsLeft: "{count} Tabletten",
daysLeft: "{count} Tage übrig",
+1 -2
View File
@@ -6,13 +6,12 @@ dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
const EnvSchema = z.object({
NODE_ENV: z.enum(["development", "production", "test"]).default("development"),
PORT: z.string().transform((v) => parseInt(v, 10)).default("3000"),
DATABASE_URL: z.string().default("file:./data/medassist.db"),
DATABASE_URL: z.string().default("file:./data/medassist-ng.db"),
CORS_ORIGINS: z.string().default("http://localhost:5173,http://localhost:4173"),
LOG_LEVEL: z.string().default("info"),
JWT_SECRET: z.string().min(10),
REFRESH_SECRET: z.string().min(10),
COOKIE_SECRET: z.string().min(10),
CSRF_SECRET: z.string().min(10),
ACCESS_TOKEN_TTL_MIN: z.string().default("15"),
REFRESH_TOKEN_TTL_DAYS: z.string().default("14"),
});
+10 -10
View File
@@ -97,7 +97,7 @@ export async function plannerRoutes(app: FastifyInstance) {
const html = `
<div style="font-family: system-ui, -apple-system, sans-serif; max-width: 100%; margin: 0 auto; padding: 12px; background: #f9fafb;">
<div style="background: white; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
<h2 style="color: #1f2937; margin: 0 0 8px; font-size: 18px;">MedAssist - Demand Calculator</h2>
<h2 style="color: #1f2937; margin: 0 0 8px; font-size: 18px;">MedAssist-ng - Demand Calculator</h2>
<p style="color: #6b7280; margin: 0 0 16px; font-size: 13px;">Supply overview from <strong>${fromDate}</strong> to <strong>${untilDate}</strong></p>
<div style="padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; ${
@@ -129,12 +129,12 @@ export async function plannerRoutes(app: FastifyInstance) {
</div>
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 16px 0;" />
<p style="color: #9ca3af; font-size: 11px; margin: 0;">Sent from MedAssist Medication Planner</p>
<p style="color: #9ca3af; font-size: 11px; margin: 0;">Sent from MedAssist-ng Medication Planner</p>
</div>
</div>
`;
const plainText = `MedAssist - Demand Calculator
const plainText = `MedAssist-ng - Demand Calculator
Supply overview from ${fromDate} to ${untilDate}
${summaryText}
@@ -142,7 +142,7 @@ ${summaryText}
${rows.map((r) => `${r.medicationName}: ${r.totalPills} pills in stock, ${r.plannerUsage} pills needed, ${r.stripsAvailable} blisters available (${r.stripsNeeded} needed) - ${r.enough ? "Enough" : "OUT OF STOCK"}`).join("\n")}
---
Sent from MedAssist Medication Planner`;
Sent from MedAssist-ng Medication Planner`;
try {
const transporter = nodemailer.createTransport({
@@ -158,7 +158,7 @@ Sent from MedAssist Medication Planner`;
await transporter.sendMail({
from: smtpFrom,
to: email,
subject: `MedAssist - Supply Overview (${fromDate} - ${untilDate})`,
subject: `MedAssist-ng - Supply Overview (${fromDate} - ${untilDate})`,
text: plainText,
html,
});
@@ -208,7 +208,7 @@ Sent from MedAssist Medication Planner`;
const html = `
<div style="font-family: system-ui, -apple-system, sans-serif; max-width: 100%; margin: 0 auto; padding: 12px; background: #f9fafb;">
<div style="background: white; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
<h2 style="color: #1f2937; margin: 0 0 8px; font-size: 18px;">⚠️ MedAssist - Reorder Reminder</h2>
<h2 style="color: #1f2937; margin: 0 0 8px; font-size: 18px;">⚠️ MedAssist-ng - Reorder Reminder</h2>
<p style="color: #6b7280; margin: 0 0 16px; font-size: 13px;">The following medications are running low and need to be reordered:</p>
<div style="padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: #fef2f2; border: 1px solid #fecaca;">
@@ -234,19 +234,19 @@ Sent from MedAssist Medication Planner`;
</div>
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 16px 0;" />
<p style="color: #9ca3af; font-size: 11px; margin: 0;">Sent from MedAssist Medication Planner</p>
<p style="color: #9ca3af; font-size: 11px; margin: 0;">Sent from MedAssist-ng Medication Planner</p>
</div>
</div>
`;
const plainText = `MedAssist - Reorder Reminder
const plainText = `MedAssist-ng - Reorder Reminder
The following medications are running low:
${lowStock.map((r) => `${r.name}: ${r.medsLeft} pills left, ${r.daysLeft ?? 0} days remaining, runs out ${r.depletionDate ?? "soon"}`).join("\n")}
---
Sent from MedAssist Medication Planner`;
Sent from MedAssist-ng Medication Planner`;
try {
const transporter = nodemailer.createTransport({
@@ -262,7 +262,7 @@ Sent from MedAssist Medication Planner`;
await transporter.sendMail({
from: smtpFrom,
to: email,
subject: `⚠️ MedAssist - ${lowStock.length} Medication${lowStock.length > 1 ? "s" : ""} Running Low`,
subject: `⚠️ MedAssist-ng - ${lowStock.length} Medication${lowStock.length > 1 ? "s" : ""} Running Low`,
text: plainText,
html,
});
+6 -6
View File
@@ -199,15 +199,15 @@ export async function settingsRoutes(app: FastifyInstance) {
await transporter.sendMail({
from: smtpFrom,
to: email,
subject: "MedAssist - Test Email",
text: "This is a test email from MedAssist. If you received this, your email configuration is working correctly!",
subject: "MedAssist-ng - Test Email",
text: "This is a test email from MedAssist-ng. If you received this, your email configuration is working correctly!",
html: `
<div style="font-family: system-ui, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;">
<h2 style="color: #2563eb;">MedAssist - Test Email</h2>
<p>This is a test email from MedAssist.</p>
<h2 style="color: #2563eb;">MedAssist-ng - Test Email</h2>
<p>This is a test email from MedAssist-ng.</p>
<p style="color: #10b981; font-weight: 600;">✓ If you received this, your email configuration is working correctly!</p>
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 20px 0;" />
<p style="color: #6b7280; font-size: 14px;">Sent from MedAssist Medication Planner</p>
<p style="color: #6b7280; font-size: 14px;">Sent from MedAssist-ng Medication Planner</p>
</div>
`,
});
@@ -228,7 +228,7 @@ export async function settingsRoutes(app: FastifyInstance) {
}
try {
const result = await sendShoutrrrNotification(url, "MedAssist Test", "This is a test notification from MedAssist. If you received this, your notification configuration is working correctly!");
const result = await sendShoutrrrNotification(url, "MedAssist-ng Test", "This is a test notification from MedAssist-ng. If you received this, your notification configuration is working correctly!");
if (result.success) {
return reply.send({ success: true, message: "Test notification sent successfully" });