Skip to content
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
452 changes: 276 additions & 176 deletions README.md

Large diffs are not rendered by default.

22 changes: 1 addition & 21 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,13 @@ import ProfilePage from './Pages/profile/Profile'
import AboutPage from './Pages/AboutUs'
import SettingsPage from './Pages/Settings/Settings'

// day 22 I am fucked beyond comprehension
// Test tracing and generation
// Add the abiilty to send a workflow
// Clean the copilot frontend / backend files
// merge to main
// fix CV
// For after 12 am
// Deploy the website
// Create CI / CD
// push to main
// victory dance

// big objectives must start at 24th to give myself a chance of finishing them
// big objectives
// ADD THE ABILITY TO SEND USER WORKFLOWS TO ADD ON IT/FIX IT - HARD - BACKEND HEAVY
// ADD THE ABILITY TO CREATE CUSTOM NODES - VERY HARD - F/B HEAVY ON BOTH
// ADD THE ABILITY TO SAVE CREDENTIALS OR FIGURE OUT A WAY TO DO IT AUTOMATICALLY - HARD F/B HEAVY ON BOTH
// USE LANGCHAIN

// white screen appearing on reload then page appears

// objectives for today:
/**
*
* Create Tests for everything except copilot
*/


function App() {
return (
<BrowserRouter>
Expand Down
6 changes: 5 additions & 1 deletion client/src/Pages/community/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ const PostCard: React.FC<PostCardProps> = ({
const likeMutation = useToggleLike(userId);
const exportContent = useExportPost();

const imageUrl = post.photo ? `${BASE_URL}/${post.photo}` : null;
const imageUrl = post.photo
? post.photo.startsWith('blob:')
? post.photo
: `${BASE_URL}/${post.photo}`
: null;

return (
<>
Expand Down
20 changes: 18 additions & 2 deletions client/src/Pages/community/hook/useCreatePost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ export const useCreatePost = () => {

const previousData = queryClient.getQueryData<any>(["community-posts"]);

// Create temporary photo URL if image exists
const tempPhotoUrl = inputs.image ? URL.createObjectURL(inputs.image) : "";

const optimisticPost: PostDto = {
id: Date.now(), // Temporary ID
author: `${user?.first_name} ${user?.last_name}`.trim(),
username: user?.email || "User",
avatar: user?.profile_pic || null,
title: inputs.title,
content: inputs.description || "",
photo: "", // Will be updated after server response
photo: tempPhotoUrl,
likes: 0,
comments: 0,
exports: 0,
Expand All @@ -45,13 +48,26 @@ export const useCreatePost = () => {
prependOptimisticPost(optimisticPost)
);

return { previousData };
return { previousData, tempPhotoUrl };
},

onSuccess: (_data, _inputs, context: any) => {
// queryClient.invalidateQueries({ queryKey: ["community-posts"] });

if (context?.tempPhotoUrl) {
setTimeout(() => {
URL.revokeObjectURL(context.tempPhotoUrl);
}, 500);
}
},

onError: (_err, _inputs, context: any) => {
if(context?.previousData){
queryClient.setQueryData(["community-posts"], context.previousData);
}
if (context?.tempPhotoUrl) {
URL.revokeObjectURL(context.tempPhotoUrl);
}
showToast("Failed to create post", ToastMessage.ERROR);
},
});
Expand Down
2 changes: 1 addition & 1 deletion client/src/Pages/profile/components/FollowModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const FollowModal: React.FC<FollowModalProps> = ({ title, users, onClose, onUser
scoredUsers.map((u) => (
<div key={u.id} className="follow-row" onClick={() => onUserClick(u)}>
<div className="follow-left">
<div className="follow-avatar">{u.photo_url ? <img src={u.photo_url} alt={u.full_name} /> : <span>{u.full_name[0]}</span>}</div>
<div className="follow-avatar">{u.photo_url ? <img src={import.meta.env.VITE_PHOTO_BASE_URL + u.photo_url} alt={u.full_name} /> : <span>{u.full_name[0]}</span>}</div>

<div className="follow-info">
<div className="follow-name">{u.full_name}</div>
Expand Down
4 changes: 0 additions & 4 deletions client/src/styles/Landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ body {
animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
0%, 100% { box-shadow: 0 0 40px #ff9b0060; }
50% { box-shadow: 0 0 90px #ff9b00cc; }
}

/* Nodes */
.node {
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ services:
APP_ENV: production
APP_DEBUG: "false"
restart: always
volumes:
- ./server:/var/www

backend_nginx:
image: nginx:alpine
Expand Down
1 change: 1 addition & 0 deletions microservice/custom-node-generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added readme/README-Diagrams/Generator-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme/README-Diagrams/GeneratorFlow.png
Binary file not shown.
Binary file modified readme/README-Diagrams/High-LevelWorkflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme/README-Diagrams/NSD1.png
Binary file not shown.
Binary file added readme/ci-cd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Community.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme/demo/Demo-Community.png
Binary file not shown.
Binary file added readme/demo/Landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Settings-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Settings-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Settings-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Settings-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/Signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-Landing.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-community.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-login-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-login-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-profile.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-signup-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/demo/demo-signup-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/deployment/db-build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/deployment/docker-be.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/deployment/docker-fe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/deployment/images.png
Binary file added readme/deployment/root-docker-be.png
Binary file added readme/deployment/root-docker-fe.png
Binary file added readme/development/Controller.png
Binary file added readme/development/api-interceptor.png
Binary file added readme/development/fe-folder-structure.png
Binary file added readme/development/microservices.png
Binary file added readme/development/service.png
Binary file added readme/project_highlets.jpg
15 changes: 8 additions & 7 deletions server/app/Service/ProfileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,27 @@ public static function isFollowingUser(int $userId, int $viewerId): array{
public static function uploadFile(Model $user , UploadedFile $file){
try {
$folder = 'avatar_photos';
$disk = Storage::disk('public');

if (!Storage::exists($folder)) {
Storage::makeDirectory($folder);
if (!$disk->exists($folder)) {
$disk->makeDirectory($folder);
}

if ($user->photo_url) {
$oldPath = $folder . '/' . $user->id . '-' . basename($user->photo_url);
if (Storage::exists($oldPath)) {
Storage::delete($oldPath);
if ($disk->exists($oldPath)) {
$disk->delete($oldPath);
}
}

$extension = $file->getClientOriginalExtension();
$filename = $user->id . '-' . Str::uuid() . '.' . $extension;

$path = Storage::disk('public')->putFileAs($folder, $file, $filename);

$path = $disk->putFileAs($folder, $file, $filename);

$user->photo_url = '/storage' . "/" . $path;
$user->save();
Log::debug("Success" , ["context" => $path]);
$user->save();
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
Expand Down
4 changes: 1 addition & 3 deletions server/app/Service/UserCopilotHistoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ public static function deleteHistory(int $userId, Model $userCopilotHistory){
}

public static function getDownloadableContent(int $userId , Model $history){
if($history->user_id !== $userId){
abort(403);
}


$lastMessage = $history->messages()
->latest('created_at')
Expand Down
Empty file.