💡
Project structure
core pages
layout
Splash screen
we dont autotmatically hide the splash screen, we hide it our selfvs
Project structure 1
Use efffect
Return
UI - components
ui structure
Project structure 2
all custom components should be:
reusables
customaizable
in shdacn approach
for ui elements componnet (smaller than custom comopnents, the
particles that are custom components) -
use variants to make it modular.
unified page wrapper and padding
deleted components
rtl view
import React from "react";
import { View, ViewProps } from "react-native";
import { cn } from "@/lib/utils";
export default function RTLView({
className = "flex-row-reverse ",
children,
...props
}: ViewProps & { className?: string }) {
return (
Project structure 3
<View
// @ts-ignore: className is for NativeWind
className={className}
{...props}
>
{children}
</View>
);
}
rtl text
import React from "react";
import { Text, TextProps } from "react-native";
// NativeWind: use className for Tailwind-like styling
export default function RTLText({
style,
className = "text-right",
children,
...props
}: TextProps & { className?: string }) {
return (
<Text
style={[{ writingDirection: "rtl", textAlign: "right" }, style]}
className={className}
{...props}
>
{children}
</Text>
);
}
LTR view
Project structure 4
import React from "react";
import { View, ViewProps } from "react-native";
export default function LTRView({
className = "flex-row",
children,
...props
}: ViewProps & { className?: string }) {
return (
<View
// @ts-ignore: className is for NativeWind
className={className}
{...props}
>
{children}
</View>
);
}
LTR text
import React from "react";
import { Text, TextProps } from "react-native";
// NativeWind: use className for Tailwind-like styling
export default function LTRText({ style, className = "text-left", children,
return (
<Text
style={[{ writingDirection: "ltr", textAlign: "left" }, style]}
className={className}
{...props}
>
{children}
</Text>
Project structure 5
);
}
features
chat feature
General structure
folder structure theory
Project structure 6
Project structure 7
chat gpt response
Project structure 8
Project structure 9
biz logic
so the idea - what does your business need- like the workflows
Project structure 10
Project structure 11
actual folder structure
full on summary - my words
Project structure 12
Project structure 13
Project structure 14
models
Domain modules
the idea of domain modules, is to combine between the different services
- they are the controllers, basiclly
Project structure 15
Project structure 16
the idea - the exact shape of a data as it corsses boundraies -
A repository:
Project structure 17
Project structure 18
Project structure 19
another propsoesd structure
Project structure 20
Project structure 21
explnation
Project structure 22
Project structure 23
app folder organizaiton
Project structure 24
Data flow
unit_ lessons → lesson
Project structure 25
Code
backend
services
openai
chat-service.js
What it does:
How it works
1. first, append the user message to the newHistory varaible.
2. make an open ai call
3. if is not a function call, we will append the message from
openai, to the new history, with the assistant role, and return
the new history.
4. if it is a function call, we will look for all tool call.
5. than take the args, and because we have only one function
schema, i know it will use the completeTask, so i just call it ,
and get a return value from it. (i know its a string).
6. than, i appeand it to the newHistory, but just with the
function_call_output type.
7. i call then onceagain, to it, with the new history, to openai api.
8. than i appeand the message i get from the response.output, i
appeand it to the new history.
9. i then return the new History.
Project structure 26