Compare commits
3 Commits
v0.0.1
...
docker_wor
| Author | SHA1 | Date | |
|---|---|---|---|
| c829cb2a6b | |||
|
|
9cba46e427 | ||
| 7beb46606f |
@@ -1 +1,2 @@
|
||||
.env
|
||||
kittyurl-frontend/node_modules
|
||||
@@ -1,11 +1,12 @@
|
||||
# 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
|
||||
|
||||
WORKDIR /app
|
||||
COPY ./kittyurl-frontend/package*.json ./
|
||||
RUN npm ci && npm cache clean --force
|
||||
COPY ./kittyurl-frontend/ .
|
||||
COPY ./kittyurl-frontend/. ./
|
||||
RUN npm run build
|
||||
|
||||
FROM node:24-trixie-slim AS production
|
||||
|
||||
71
README.md
71
README.md
@@ -1,2 +1,73 @@
|
||||
# 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
|
||||
```
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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" />
|
||||
<title>kittyurl - shorten URLs with ease</title>
|
||||
<meta property="og:title" content="kittyurl shortener" />
|
||||
<meta property="og:type" content="website" />
|
||||
<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:title" content="kittyurl shortener" />
|
||||
<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>
|
||||
|
||||
@@ -11,6 +11,13 @@ export type View = 'home' | 'login' | 'history' | 'jump-game' | 'flappy-game';
|
||||
|
||||
const getSubdomain = () => {
|
||||
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('.');
|
||||
if (parts.length <= 2) return null;
|
||||
return parts[0];
|
||||
|
||||
BIN
kittyurl-frontend/src/assets/Ket.jpg
Normal file
BIN
kittyurl-frontend/src/assets/Ket.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 228 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 MiB |
BIN
kittyurl-frontend/src/assets/kitty.jpg
Normal file
BIN
kittyurl-frontend/src/assets/kitty.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.9 MiB |
Reference in New Issue
Block a user