Skip to content

Commit

Permalink
Merge pull request #163 from thanhdanh27600/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
thanhdanh27600 authored Sep 10, 2023
2 parents 392c8c9 + d19fd18 commit d954e28
Show file tree
Hide file tree
Showing 19 changed files with 389 additions and 321 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Clickdi - URL Shortener
# Quickshare - URL Shortener

Lightweight web application for shortening URLs, along with real-time click tracking, differentiate between real and unique clicks, free to use and modify.
Lightweight web application for create notes and shortening URLs, along with real-time click tracking, differentiate between real and unique clicks, free to use.

## What's this

- **Shortening URLs**: Shorten link to 3 unique hash xxx (clid.top/xxx), link saved by IP, no sign in required tracking shortened link goes publicly, unless set new password
- **Creat Note & Shorten URLs**: Create note super easy with shortened link to 3 unique hash xxx (qsh.at/xxx), link then saved by IP, no sign in required.

- **Detect Uniqe Clicks**: Tracks clicks on the shortened URLs in real-time (polling)
- **Tracking URLs**: Resource management (note & shortened link) goes publicly, unless set new password.

- **Detect Unique Clicks**: Tracks clicks on the shortened URLs in polling time

- **Detect Human Clicks**: Distinguish genuine clicks from bots or automated scripts

- **Free to Use**: Free to clone, modify, and distribute.
- **Free to Use**: Start to use [https://quickshare.at](https://quickshare.at)
, always free

## How to Build

*To be updated*
- Copy `.env.example` and modify to your credential
- Remove `.gpg` files
- `yarn install` & `yarn dev`

## Contact

Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"brandDescription": "Share and Create Free Notes with URLs Shortener. Quickshare save your notes, texts, and track shortened links, click counts, locations, and all related data.",
"advancedView": "Advanced info",
"loadMore": "Load more",
"editPreview": "More options",
"editPreview": "Edit links",
"save": "Save",
"maximumCharaters": "Maximum of {{n}} characters",
"uploadImage": "Upload image",
Expand Down
4 changes: 2 additions & 2 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

<url>
<loc>https://quickshare.at</loc>
<lastmod>2023-07-22</lastmod>
<lastmod>2023-09-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>

<url>
<loc>https://quickshare.at/en</loc>
<lastmod>2023-07-22</lastmod>
<lastmod>2023-09-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
Expand Down
31 changes: 19 additions & 12 deletions src/api/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,24 @@ export const updateShortenUrlRequest = async ({
mediaId?: number;
locale: Locale;
}) => {
const rs = await API.put(`/api/shorten/update`, {
locale,
hash,
ogTitle,
ogDescription,
ogImgSrc,
ogImgPublicId,
theme,
mediaId,
});
const rs = await API.put(
`/api/shorten/update`,
{
locale,
hash,
ogTitle,
ogDescription,
ogImgSrc,
ogImgPublicId,
theme,
mediaId,
},
{
headers: {
...withAuth(),
},
},
);
const data = rs.data;
return data as ShortenUrl;
};
Expand All @@ -68,7 +76,6 @@ export const getStats = async ({
hash,
email,
password,
token,
queryCursor,
}: {
hash: string;
Expand All @@ -85,7 +92,7 @@ export const getStats = async ({
});
const rs = await API.get(`/api/stats?${q}`, {
headers: {
...withAuth(token),
...withAuth(),
},
});
const data = rs.data;
Expand Down
1 change: 1 addition & 0 deletions src/components/atoms/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Accordion = ({ children, title, defaultOpen, className }: Props) =>
className="[&:not([data-te-collapse-collapsed])]:text-primary group relative flex w-full items-center rounded-none border-0 py-4 text-left text-base transition [overflow-anchor:none] hover:z-[2] focus:z-[3] focus:outline-none"
type="button"
data-te-collapse-init
data-te-collapse-collapsed
data-te-target={`#${collapseId}`}
aria-controls={collapseId}>
<span className="h-4 w-4 rotate-[-180deg] fill-[#336dec] transition-transform duration-200 ease-in-out group-[[data-te-collapse-collapsed]]:mr-0 group-[[data-te-collapse-collapsed]]:rotate-0 group-[[data-te-collapse-collapsed]]:fill-[#212529] motion-reduce:transition-none">
Expand Down
14 changes: 12 additions & 2 deletions src/components/atoms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTML
variant?: ButtonVariants;
loading?: boolean;
animation?: boolean;
hoverTransform?: boolean;
}

export const Button = (props: ButtonProps) => {
const { text = 'Button', variant = 'filled', loading, animation, TextClassname, ...otherProps } = props;
const {
text = 'Button',
variant = 'filled',
loading,
animation,
hoverTransform = true,
TextClassname,
...otherProps
} = props;
return (
<button
{...otherProps}
Expand All @@ -22,7 +31,8 @@ export const Button = (props: ButtonProps) => {
{
'py-2.5 text-white focus:outline-none focus:ring-cyan-400': variant === 'filled',
'hover:gradient-bg from-purple-600 to-cyan-600/80': animation,
'from-blue-600 to-cyan-500 hover:opacity-80 hover:shadow-btn-hover': !animation,
'from-blue-600 to-cyan-500': !animation,
'hover:-translate-y-1 hover:translate-x-1 hover:opacity-80 hover:shadow-btn-hover': hoverTransform,
'relative inline-flex items-center justify-center overflow-hidden border border-cyan-300 bg-none p-1 text-gray-900 hover:text-cyan-500 focus:outline-none focus:ring-cyan-400':
variant === 'outlined',
},
Expand Down
13 changes: 6 additions & 7 deletions src/components/gadgets/AdvancedSettingUrlForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ export const AdvancedSettingUrlForm = () => {
}, [ogTitle, ogDescription]);

useEffect(() => {
if (shortenHistory)
debouncedUpdate({
ogTitle: shortenHistory.ogTitle || t('ogTitle', { hash: shortenHistory.hash ?? 'XXX' }),
ogDescription: shortenHistory.ogDescription || t('ogDescription'),
ogImgSrc: shortenHistory.ogImgSrc,
});
}, [shortenHistory]);
debouncedUpdate({
ogTitle: shortenHistory?.ogTitle || t('ogTitle', { hash: shortenHistory?.hash ?? 'XXX' }),
ogDescription: shortenHistory?.ogDescription || t('ogDescription'),
ogImgSrc: shortenHistory?.ogImgSrc,
});
}, []);

const updateShortenUrl = useMutation(QueryKey.SHORTEN_UPDATE, {
mutationFn: updateShortenUrlRequest,
Expand Down
10 changes: 6 additions & 4 deletions src/components/layouts/LayoutMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { BrandHead } from './BrandHead';
import { Footer } from './Footer';
import { Header } from './Header';

export const LayoutMain = ({ children }: React.PropsWithChildren) => {
export const LayoutMain = ({ children, featureTab = true }: React.PropsWithChildren & { featureTab?: boolean }) => {
return (
<div className="bg-gray-50/50">
<BrandHead />
<Header />
<div className={clsx('container-xl mx-auto mb-0 min-h-[80vh] p-4 max-sm:py-8 sm:mb-16 md:max-w-7xl')}>
<div className={'mb-8'}>
<FeatureTabs />
</div>
{featureTab && (
<div className={'mb-8'}>
<FeatureTabs />
</div>
)}
{children}
</div>
<Footer />
Expand Down
Loading

0 comments on commit d954e28

Please sign in to comment.