3 Commits

Author SHA1 Message Date
c829cb2a6b fix: docker packages and IP parsing for 127.0.0.1
Some checks failed
Release new version / release (push) Successful in 27s
Update changelog / changelog (push) Successful in 26s
Build and push Docker image / build (push) Failing after 3m57s
2026-01-09 21:55:46 +01:00
Pc
9cba46e427 fix: optimized size of kitty photos
All checks were successful
Update changelog / changelog (push) Successful in 26s
2026-01-09 14:48:37 +01:00
7beb46606f Updated readme with the current state of app
All checks were successful
Update changelog / changelog (push) Successful in 25s
2026-01-07 23:52:13 +01:00
9 changed files with 85 additions and 5 deletions

View File

@@ -1 +1,2 @@
.env .env
kittyurl-frontend/node_modules

View File

@@ -1,11 +1,12 @@
# Credit: https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker # Credit: https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
# https://stackoverflow.com/a/56941391
FROM node:24-trixie-slim AS builder FROM node:24-trixie-slim AS builder
WORKDIR /app WORKDIR /app
COPY ./kittyurl-frontend/package*.json ./ COPY ./kittyurl-frontend/package*.json ./
RUN npm ci && npm cache clean --force RUN npm ci && npm cache clean --force
COPY ./kittyurl-frontend/ . COPY ./kittyurl-frontend/. ./
RUN npm run build RUN npm run build
FROM node:24-trixie-slim AS production FROM node:24-trixie-slim AS production

View File

@@ -1,2 +1,73 @@
# kittyFE # kittyFE
*Front-end for the [KittyURL](https://gitea.7o7.cx/kittyteam/kittyurl) project — create short and memorable URLs with ease!*
## Goals
Provide a responsive and modern user interface for:
* Account management (login, register, history, settings)
* Link creation (public landing page)
* Dashboard link management (for logged-in users)
* User management (admin panel)
KittyFE is built with **Vite + React (TypeScript)** to integrate seamlessly with [kittyBE](https://gitea.7o7.cx/kittyteam/kittyBE) and is easily dockerizable.
## Running kittyFE
KittyFE has been verified to work on **Node v24.11.1**.
### On bare metal
Running the front-end is as simple as:
1. **Install dependencies**
* To download the required dependencies:
```sh
npm install
```
* To install an exact copy of all dependencies (recommended for CI):
```sh
npm ci
```
2. **Configure environment variables**
Copy the `.env.example` file to `.env` and customize it to your preferences.
**Example:** Tell the frontend where the backend API is located. Your `.env` file should look like this:
```properties
VITE_API_TARGET=http://localhost:6567
```
> **Important:** All environment variables exposed to Vite must start with `VITE_`. Make sure the URL matches your running instance of `kittyBE`.
3. **Launch the development server**
```sh
npm run dev
```
4. **Open the app**
Visit:
```text
http://localhost:6568
```
(or the port shown in your terminal output).
### Building for production
To create an optimized static production build:
```sh
npm run build
```

View File

@@ -2,18 +2,18 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/assets/kitty.png" /> <link rel="icon" type="image/svg+xml" href="/src/assets/kitty.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>kittyurl - shorten URLs with ease</title> <title>kittyurl - shorten URLs with ease</title>
<meta property="og:title" content="kittyurl shortener" /> <meta property="og:title" content="kittyurl shortener" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:description" content="Your go-to place for short and memorable URLs." /> <meta property="og:description" content="Your go-to place for short and memorable URLs." />
<meta property="og:image" content="/src/assets/Ket.png" /> <meta property="og:image" content="/src/assets/Ket.jpg" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="kittyurl shortener" /> <meta name="twitter:title" content="kittyurl shortener" />
<meta name="twitter:description" content="Your go-to place for short and memorable URLs." /> <meta name="twitter:description" content="Your go-to place for short and memorable URLs." />
<meta name="twitter:image" content="/src/assets/Ket.png" /> <meta name="twitter:image" content="/src/assets/Ket.jpg" />
</head> </head>

View File

@@ -11,6 +11,13 @@ export type View = 'home' | 'login' | 'history' | 'jump-game' | 'flappy-game';
const getSubdomain = () => { const getSubdomain = () => {
const hostname = window.location.hostname; const hostname = window.location.hostname;
// Handle localhost and 127.0.0.1 cases.
// For more advanced cases (like bare IP hosting)
// a regex may be necessary.
if (hostname === 'localhost' || hostname === '127.0.0.1') {
return null;
}
const parts = hostname.split('.'); const parts = hostname.split('.');
if (parts.length <= 2) return null; if (parts.length <= 2) return null;
return parts[0]; return parts[0];

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB