diff --git a/.example.env b/.example.env index 4510764..d1d9d70 100644 --- a/.example.env +++ b/.example.env @@ -1,2 +1,8 @@ +# Database connection string DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres + +# JWT secret for signing tokens JWT_SECRET=verysecret + +# Application name +APP_NAME=notra diff --git a/package-lock.json b/package-lock.json index f8268f3..4b4e77f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "rhyme", + "name": "notra", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "rhyme", + "name": "notra", "version": "0.1.0", "dependencies": { "bcrypt": "^6.0.0", diff --git a/package.json b/package.json index 15089ce..12d760e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "rhyme", + "name": "notra", "version": "0.1.0", "private": true, "scripts": { diff --git a/src/app/auth/page.tsx b/src/app/auth/page.tsx index bd81afb..0dad324 100644 --- a/src/app/auth/page.tsx +++ b/src/app/auth/page.tsx @@ -1,9 +1,14 @@ import { Metadata } from "next"; import AuthForm from "@/components/forms/AuthForm"; +const APP_NAME = process.env.APP_NAME; +if (!APP_NAME) { + throw new Error("APP_NAME environment variable is not set"); +} + export const metadata: Metadata = { - title: "Authenticate - Rhyme", - description: "Register or log into Rhyme account to save, show and load notes", + title: "Authenticate - " + APP_NAME, + description: `Register or log into ${APP_NAME} account to save, show and load notes`, }; export default function Auth() { @@ -15,7 +20,7 @@ export default function Auth() {
-

Welcome to Rhyme!

+

Welcome to {APP_NAME}!

Free service for writing and saving notes, lyrics, poetry, etc

Made with ❤️ by Kirill Siukhin

diff --git a/src/app/favicon.ico b/src/app/favicon.ico index 3a09c97..25bb1f3 100644 Binary files a/src/app/favicon.ico and b/src/app/favicon.ico differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4228bc4..f956250 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,13 +3,18 @@ import { Noto_Sans_Mono } from "next/font/google"; import Header from "@/components/Header"; import "./globals.css"; +const APP_NAME = process.env.APP_NAME; +if (!APP_NAME) { + throw new Error("APP_NAME environment variable is not set"); +} + const notoSansMono = Noto_Sans_Mono({ variable: "--noto-sans-mono", subsets: ["latin", "cyrillic"], }); export const metadata: Metadata = { - title: "Rhyme", + title: APP_NAME, description: "Free service for writing and saving notes, lyrics, poetry and more", }; diff --git a/src/app/notes/page.tsx b/src/app/notes/page.tsx index 531662c..cd84316 100644 --- a/src/app/notes/page.tsx +++ b/src/app/notes/page.tsx @@ -3,9 +3,13 @@ import { requireAuth } from "@/app/actions/auth"; import { getNotes } from "@/app/actions/notes"; import NoteCard from "@/components/ui/NoteCard"; +const APP_NAME = process.env.APP_NAME; +if (!APP_NAME) { + throw new Error("APP_NAME environment variable is not set"); +} + export const metadata: Metadata = { - title: "Notes - Rhyme", - description: "View and edit your notes", + title: "Notes - " + APP_NAME, }; export default async function Notes() { diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 5278717..b8be5c2 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -4,13 +4,18 @@ import { getAuth, logOut } from "@/app/actions/auth"; import { createNote } from "@/app/actions/notes"; import HeaderButton from "./ui/HeaderButton"; +const APP_NAME = process.env.APP_NAME; +if (!APP_NAME) { + throw new Error("APP_NAME environment variable is not set"); +} + export default async function Header() { const user = await getAuth(); return (
- + {user && (