Skip to content

Commit

Permalink
Redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
maksugr committed May 6, 2024
1 parent 99b0f27 commit 7a89ac3
Show file tree
Hide file tree
Showing 132 changed files with 826 additions and 1,116 deletions.
6 changes: 1 addition & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ REDDIT_USER_AGENT=
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_USERNAME=
REDDIT_PASSWORD=

FIREBASE_PRIVATE_KEY=

OPENAI_API_KEY=
REDDIT_PASSWORD=
6 changes: 0 additions & 6 deletions share/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,4 @@ export const CONFIG = {
username: env['REDDIT_USERNAME'],
password: env['REDDIT_PASSWORD'],
},
firebase: {
privateKey: env['FIREBASE_PRIVATE_KEY'],
},
openai: {
apiKey: env['OPENAI_API_KEY'],
},
};
2 changes: 0 additions & 2 deletions share/constants/icon.ts

This file was deleted.

196 changes: 0 additions & 196 deletions share/constants/languages.ts

This file was deleted.

2 changes: 1 addition & 1 deletion share/constants/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const DOMAIN =
process.env.NODE_ENV === 'production'
? DOMAIN_PRODUCTION
: 'http://localhost:3000';
const TITLE = 'Überwörterbuch';
export const TITLE = 'Überwörterbuch';
const DESCRIPTION = 'Das urbanste deutsche Wörterbuch';
const LANGUAGE_CODE = 'de-de';
const IMAGES_GH_PATH =
Expand Down
1 change: 1 addition & 0 deletions share/constants/search.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const MINIMAL_SEARCH_VALUE_LENGTH = 3;
5 changes: 5 additions & 0 deletions share/enums/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum ApiRouteEnum {
API = 'api',
WORD = 'word',
RANDOM = 'random',
}
1 change: 1 addition & 0 deletions share/enums/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum RouteEnum {
INDEX = '/',
WORDS = 'words',
SEARCH = 'search',
}
2 changes: 1 addition & 1 deletion share/enums/search-param.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export enum SearchParamEnum {
LANGUAGE = 'language',
SLUG = 'slug',
}
9 changes: 8 additions & 1 deletion share/scripts/file-from-word.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

import { wordNameToSlug } from '../utils/words';
import { WORDS_FOLDER_NAME } from '../constants/word';

import { getAuthor } from './getters/get-author';
import { getDescription } from './getters/get-description';
Expand All @@ -27,7 +28,13 @@ author: ${getAuthor()}
---
`;

const filePath = join(__dirname, '..', '..', 'words', `${fileName}.mdx`);
const filePath = join(
__dirname,
'..',
'..',
WORDS_FOLDER_NAME,
`${fileName}.mdx`
);
writeFileSync(filePath, fileTemplate);

console.info(`Word: "${word}"`);
Expand Down
9 changes: 1 addition & 8 deletions share/scripts/telegram/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import TelegramBot from 'node-telegram-bot-api';

import { wordNameToSlug } from '../../utils/words';
import { getRandomMessage } from '../../utils/random';
import { IWord } from '../../interfaces/words';
import { trimTemplateString } from '../../utils/strings';
import { generateTelegramTitle } from '../../utils/titles';
Expand All @@ -14,13 +13,7 @@ const getTelegramNewWordMessage = (
slug: string,
emoji?: string
) => {
const telegramMessageTitle = `\n\n${generateTelegramTitle(
title,
slug,
emoji
)}\n\n`;

return getRandomMessage(telegramMessageTitle);
return generateTelegramTitle(title, slug, emoji);
};

export const sendTelegramNewWordMessage = async (words: IWord[]) => {
Expand Down
9 changes: 1 addition & 8 deletions share/scripts/twitter/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TwitterApi } from 'twitter-api-v2';

import { getRandomMessage } from '../../utils/random';
import { wordNameToSlug } from '../../utils/words';
import { IWord } from '../../interfaces/words';
import { generateTwitterTitle } from '../../utils/titles';
Expand All @@ -18,13 +17,7 @@ const getTwitterNewWordMessage = (
slug: string,
emoji?: string
) => {
const twitterMessageTitle = `\n\n${generateTwitterTitle(
title,
slug,
emoji
)}\n\n`;

return getRandomMessage(twitterMessageTitle);
return generateTwitterTitle(title, slug, emoji);
};

export const sendTwitterNewWordMessage = async (words: IWord[]) => {
Expand Down
67 changes: 0 additions & 67 deletions share/utils/ai.ts

This file was deleted.

4 changes: 0 additions & 4 deletions share/utils/firebase/enums.ts

This file was deleted.

Loading

0 comments on commit 7a89ac3

Please sign in to comment.