Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs launchpad and improve ui and start setup local dev docker WIP #480

Merged
merged 5 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use a Node.js base image
FROM node:20

# Set the working directory
WORKDIR /app

# Copy package.json and pnpm-lock.yaml
COPY package.json pnpm-lock.yaml ./

# Install pnpm
RUN npm install -g pnpm

# Install dependencies
RUN pnpm install

# Copy the rest of the application code
COPY . .

# Build the application
ARG APP_PATH
RUN pnpm run build --filter=${APP_PATH}

# Expose the port the app runs on
EXPOSE 3000

# Start the application
CMD ["pnpm", "run", "start"]
4 changes: 3 additions & 1 deletion apps/data-backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NODE_ENV="development"

TELEGRAM_WEB_APP="https://tg.afk-community.xyz"

INDEXER_DATABASE_URL="postgresql://postgres:postgres@localhost:5434/indexer"
Expand Down Expand Up @@ -28,7 +30,7 @@ STARKNET_RPC_NETWORK="SN_SEPOLIA" # SN_SEPOLIA, SN_MAIN
RPC_NODE_API_KEY=""
SN_NETWORK="SN_SEPOLIA"


IS_TELEGRAM_BOT_RUNNING="false"
# Cloudfare
CLOUDFARE_ACCOUNT_ID=""
CLOUDFARE_AUTH_TOKEN=""
Expand Down
13 changes: 8 additions & 5 deletions apps/data-backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ async function start() {
console.log(`Server listening on ${host}:${config.server.port}`);

// Launch Telegram bot
try {
await launchBot(process.env.TELEGRAM_BOT_TOKEN || '');
} catch (error) {
console.error('Error launching bot:', error);
}

if (process.env.TELEGRAM_BOT_TOKEN && process.env.IS_TELEGRAM_BOT_RUNNING === 'true') {
try {
await launchBot(process.env.TELEGRAM_BOT_TOKEN || '');
} catch (error) {
console.log('Error launching bot:', error);
}
}
} catch (err) {
console.error(err);
process.exit(1);
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/screens/Games/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {SafeAreaView} from 'react-native-safe-area-context';
import {useStyles, useTheme, useWindowDimensions} from '../../hooks';
import {PixelPeace} from '../../modules/PixelPeace';
import {GameSreenProps} from '../../types';
import {SelectedTab, TABS_MENU} from '../../types/tab';
import {SelectedTab, CONSOLE_TABS_MENU} from '../../types/tab';
import {AllKeysComponent} from '../KeysMarketplace/AllKeysComponent';
import {LaunchpadComponent} from '../Launchpad/LaunchpadComponent';
import {SlinksMap} from '../Slink/SlinksMap';
Expand Down Expand Up @@ -44,7 +44,7 @@ export const Games: React.FC<GameSreenProps> = ({navigation}) => {
]}
showsVerticalScrollIndicator={false}
>
{TABS_MENU.map((option) => (
{CONSOLE_TABS_MENU.map((option) => (
<Pressable
style={[styles.menuItem, {borderRadius: isDesktop ? 20 : 15}]}
onPress={() => handleTabSelected(option.tab)}
Expand Down
66 changes: 66 additions & 0 deletions apps/mobile/src/types/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,5 +511,71 @@ export const TABS_COMMUNITY: {screen?: string; title: string; tab: SelectedTab}[
// screen: "ChannelsFeed",
// tab: SelectedTab.MESSAGES

// },
];

export const CONSOLE_TABS_MENU: {screen?: string; title: string; description: string; tab: SelectedTab}[] = [
{
title: 'Pump',
description: 'Launch your token to be trade and pumped',
screen: 'Launchpad',
tab: SelectedTab.LAUNCHPAD_VIEW,
},
{
title: 'Pixel Peace',
description: 'Pixel Game for communities',
screen: 'PixelPeace',
tab: SelectedTab.PIXEL_PEACE,
},
{
title: 'Nameservice',
description: 'AFK nameservice to mint your own name.afk',
screen: 'AFK Nameservice',
tab: SelectedTab.NAMESERVICE,
},
// {
// title: 'AFK ID',
// screen: 'AFK ID',
// tab: SelectedTab.AFK_ID,
// },
{
title: 'Keys',
description: 'Launch your own keys as a Starknet user linked to your profile',
screen: 'KeysMarketplace',
tab: SelectedTab.VIEW_KEYS_MARKETPLACE,
},
// {
// title: 'Slink',
// description: 'Slink Description',
// screen: 'Slink',
// tab: SelectedTab.SLINK,
// },
// {
// title: '?',
// description: '? Description',
// screen: '?',
// tab: SelectedTab.LAUNCH_TOKEN_UNRUGGABLE,
// },
// {
// title: '?!',
// description: '?! Description',
// screen: '?!',
// tab: SelectedTab.LAUNCH_TOKEN_PUMP,
// },
// {
// title: 'Channel',
// screen: 'CreateChannel',
// tab: SelectedTab.CREATE_CHANNEL,
// },
// {
// title: 'Token',
// screen: 'LaunchToken',
// tab: SelectedTab.LAUNCH_TOKEN,
// },
// {
// title: 'Messages',
// screen: "ChannelsFeed",
// tab: SelectedTab.MESSAGES

// },
];
66 changes: 66 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '3.8'

services:
mobile:
build:
context: .
dockerfile: Dockerfile
args:
APP_PATH: apps/mobile
working_dir: /app/apps/mobile
command: pnpm run start
volumes:
- .:/app
ports:
- "${MOBILE_PORT}:${MOBILE_PORT}" # Use environment variable
depends_on:
- packages
env_file:
- .env

data-backend:
build:
context: .
dockerfile: Dockerfile
args:
APP_PATH: apps/data-backend
working_dir: /app/apps/data-backend
command: pnpm run start
volumes:
- .:/app
ports:
- "${DATA_BACKEND_PORT}:${DATA_BACKEND_PORT}" # Use environment variable
depends_on:
- packages
env_file:
- .env

nestjs-indexer:
build:
context: .
dockerfile: Dockerfile
args:
APP_PATH: apps/nestjs-indexer
working_dir: /app/apps/nestjs-indexer
command: pnpm run start
volumes:
- .:/app
ports:
- "${NESTJS_INDEXER_PORT}:${NESTJS_INDEXER_PORT}" # Use environment variable
depends_on:
- packages
env_file:
- .env

packages:
build:
context: .
dockerfile: Dockerfile
args:
APP_PATH: packages
working_dir: /app/packages
command: pnpm run build
volumes:
- .:/app
env_file:
- .env
Loading
Loading