= ({ diff }) => {
11 | const fileDiffs = diff && diff.split(/(?=diff --git a\/)/g);
12 |
13 | return (
14 |
19 | {diff &&
20 | fileDiffs.map((fileDiff, index) => {
21 | // Extract the file name from the diff string
22 | const match = fileDiff.match(/diff --git a\/(.+?) b\/(.+?)\n/);
23 | const fileName = match ? match[1] : `file${index + 1}`;
24 |
25 | return (
26 |
31 | );
32 | })}
33 |
34 | );
35 | };
36 |
37 | export default FilesChanged;
38 |
--------------------------------------------------------------------------------
/gui/src/app/(programmer)/pull_request/[pr_id]/OpenTag.ts:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const OpenTag = styled.button`
4 | border-radius: 24px;
5 | background: linear-gradient(
6 | 0deg,
7 | rgba(0, 0, 0, 0.4) 0%,
8 | rgba(0, 0, 0, 0.4) 100%
9 | ),
10 | #4bac1c;
11 | color: #fff;
12 | font-family: 'Proxima Nova', sans-serif;
13 | font-size: 13px;
14 | font-style: normal;
15 | font-weight: 600;
16 | line-height: normal;
17 | display: flex;
18 | padding: 6px;
19 | flex-direction: row;
20 | align-items: center;
21 | gap: 6px;
22 | `;
23 |
24 | export default OpenTag;
25 |
--------------------------------------------------------------------------------
/gui/src/app/(programmer)/pull_request/layout.tsx:
--------------------------------------------------------------------------------
1 | import { PullRequestsProvider } from '@/context/PullRequests';
2 |
3 | export default function PullRequestLayout({
4 | children,
5 | }: Readonly<{ children: React.ReactNode }>) {
6 | return (
7 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/gui/src/app/(programmer)/pull_request/pr.module.css:
--------------------------------------------------------------------------------
1 | .pr_list_container {
2 | display: flex;
3 | flex-direction: row;
4 | align-items: center;
5 | justify-content: space-between;
6 | align-self: stretch;
7 | padding: 12px 8px;
8 | border-bottom: 1px solid rgb(255 255 255 / 12%);
9 | cursor: pointer;
10 | }
11 |
12 | .pr_list_container:hover,
13 | .pr_list_container.active {
14 | background: rgb(255 255 255 / 8%);
15 | }
16 |
17 | .pr_details_header_container {
18 | padding: 24px 16px;
19 | display: flex;
20 | flex-direction: row;
21 | justify-content: space-between;
22 | width: 100%;
23 | border-bottom: 1px solid rgb(255 255 255 / 12%);
24 | }
25 |
26 | .commit_log_card_container {
27 | display: flex;
28 | padding: 8px;
29 | flex-direction: row;
30 | justify-content: space-between;
31 | align-items: center;
32 | gap: 4px;
33 | flex: 1 0 0;
34 | border-radius: 8px;
35 | background: var(--white-opacity-8);
36 | }
37 |
--------------------------------------------------------------------------------
/gui/src/app/(programmer)/workbench/layout.tsx:
--------------------------------------------------------------------------------
1 | import { WorkbenchProvider } from '@/context/Workbench';
2 |
3 | export default function BoardLayout({
4 | children,
5 | }: Readonly<{ children: React.ReactNode }>) {
6 | return (
7 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/gui/src/app/constants/ActivityLogType.ts:
--------------------------------------------------------------------------------
1 | export const ActivityLogType = {
2 | ERROR: 'ERROR',
3 | CODE: 'CODE',
4 | INFO: 'INFO',
5 | }
--------------------------------------------------------------------------------
/gui/src/app/constants/BoardConstants.ts:
--------------------------------------------------------------------------------
1 | export const storyStatus = {
2 | TODO: 'TODO',
3 | IN_PROGRESS: 'IN_PROGRESS',
4 | DONE: 'DONE',
5 | IN_REVIEW: 'IN_REVIEW',
6 | MAX_LOOP_ITERATIONS: 'MAX_LOOP_ITERATION_REACHED',
7 | LLM_KEY_NOT_FOUND: 'IN_REVIEW_LLM_KEY_NOT_FOUND',
8 | };
9 |
10 | export const showStoryDetailsDropdown = [
11 | storyStatus.TODO,
12 | storyStatus.IN_REVIEW,
13 | ];
14 |
15 | export const storyActions = {
16 | REBUILD: 'Re-Build',
17 | GET_HELP: 'GET_HELP',
18 | GO_TO_SETTINGS: 'GOTO_SETTINGS',
19 | }
--------------------------------------------------------------------------------
/gui/src/app/constants/NavbarConstants.ts:
--------------------------------------------------------------------------------
1 | import imagePath from '@/app/imagePath';
2 | import { NavbarTypes } from '../../../types/navbarTypes';
3 |
4 | export const navbarOptions: NavbarTypes[] = [
5 | {
6 | id: 'discord',
7 | text: 'Get help?',
8 | image: imagePath.discordIcon,
9 | url: 'https://discord.com/invite/dXbRe5BHJC',
10 | },
11 | ];
12 |
--------------------------------------------------------------------------------
/gui/src/app/constants/ProjectConstants.ts:
--------------------------------------------------------------------------------
1 | import imagePath from '@/app/imagePath';
2 |
3 | export const storyTypes = {
4 | BACKEND: 'BACKEND',
5 | DESIGN: 'DESIGN',
6 | };
7 |
8 | export const backendFrameworkOptions = [
9 | {
10 | id: 'flask',
11 | text: 'Flask',
12 | src: imagePath.flaskImage,
13 | available: true,
14 | },
15 | {
16 | id: 'django',
17 | text: 'Django',
18 | src: imagePath.djangoImage,
19 | available: true,
20 | },
21 | {
22 | id: 'fast_api',
23 | text: 'Fast API',
24 | src: imagePath.fastAPIImage,
25 | available: false,
26 | },
27 | ];
28 |
29 | export const frontendFrameworkOptions = [
30 | {
31 | id: 'nextjs',
32 | text: 'Next Js',
33 | src: imagePath.nextJsImage,
34 | available: true,
35 | },
36 | ];
37 |
--------------------------------------------------------------------------------
/gui/src/app/constants/PullRequestConstants.ts:
--------------------------------------------------------------------------------
1 | export const prStatuses = {
2 | OPEN: 'OPEN',
3 | CLOSED: 'CLOSED',
4 | MERGED: 'MERGED',
5 | };
6 |
--------------------------------------------------------------------------------
/gui/src/app/constants/SkeletonConstants.ts:
--------------------------------------------------------------------------------
1 | export const SkeletonTypes = {
2 | PROJECT: 'project',
3 | WORKBENCH: 'workbench',
4 | CODE: 'code',
5 | BOARD: 'board',
6 | PULL_REQUEST: 'pull_request',
7 | };
8 |
--------------------------------------------------------------------------------
/gui/src/app/constants/UtilsConstants.ts:
--------------------------------------------------------------------------------
1 | export const Servers = {
2 | BACKEND: 'backend',
3 | FRONTEND: 'frontend',
4 | };
5 |
--------------------------------------------------------------------------------
/gui/src/app/logout/page.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import React, { useEffect } from 'react';
3 | import { logout } from '@/app/utils';
4 |
5 | const Logout: React.FC = () => {
6 | useEffect(() => {
7 | logout();
8 | }, []);
9 |
10 | return (
11 |
12 | ....Logout
13 |
14 | );
15 | };
16 |
17 | export default Logout;
18 |
--------------------------------------------------------------------------------
/gui/src/app/page.tsx:
--------------------------------------------------------------------------------
1 | import LandingPage from '@/components/HomeComponents/LandingPage';
2 |
3 | export default function Home() {
4 | return (
5 |
6 |
7 |
8 | );
9 | }
10 |
--------------------------------------------------------------------------------
/gui/src/app/projects/layout.tsx:
--------------------------------------------------------------------------------
1 | import React, { ReactNode } from 'react';
2 | import NavBar from '@/components/LayoutComponents/NavBar';
3 | import styles from './projects.module.css';
4 | import { SocketProvider } from '@/context/SocketContext';
5 |
6 | export default function ProjectsLayout({
7 | children,
8 | }: Readonly<{ children: ReactNode }>) {
9 | return (
10 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/gui/src/app/projects/projects.module.css:
--------------------------------------------------------------------------------
1 | .project_content {
2 | background-color: var(--project-bg-color);
3 | border-radius: 8px 0 0;
4 | flex: 1;
5 | }
6 |
7 | .project_container {
8 | background-color: var(--white-opacity-2);
9 | display: flex;
10 | flex-direction: column;
11 | padding: 12px;
12 | height: 140px;
13 | justify-content: space-between;
14 | cursor: pointer;
15 | }
16 |
--------------------------------------------------------------------------------
/gui/src/app/providers.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import { NextUIProvider } from '@nextui-org/react';
4 | import { UserContextProvider } from '@/context/UserContext';
5 |
6 | export function Providers({ children }: { children: React.ReactNode }) {
7 | return (
8 |
9 | {children}
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/gui/src/app/settings/layout.tsx:
--------------------------------------------------------------------------------
1 | import NavBar from '@/components/LayoutComponents/NavBar';
2 | import React from 'react';
3 | import styles from '@/app/projects/projects.module.css';
4 | import { Toaster } from 'react-hot-toast';
5 |
6 | export default function SettingsLayout({
7 | children,
8 | }: Readonly<{ children: React.ReactNode }>) {
9 | return (
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/gui/src/app/settings/page.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import React from 'react';
3 | import Models from '@/app/settings/SettingsOptions/Models';
4 | import CustomSidebar from '@/components/CustomSidebar/CustomSidebar';
5 | import imagePath from '@/app/imagePath';
6 | import BackButton from '@/components/BackButton/BackButton';
7 |
8 | export default function Settings() {
9 | const options = [
10 | {
11 | key: 'models',
12 | text: 'Models',
13 | selected: imagePath.modelsIconSelected,
14 | unselected: imagePath.modelsIconUnselected,
15 | icon_css: 'size-4',
16 | component: ,
17 | },
18 | ];
19 |
20 | const handleOptionSelect = (key: string) => {
21 | console.log('Selected option:', key);
22 | };
23 |
24 | return (
25 |
26 |
27 |
28 |
34 |
35 | );
36 | }
37 |
--------------------------------------------------------------------------------
/gui/src/components/BackButton/BackButton.tsx:
--------------------------------------------------------------------------------
1 | import CustomImage from '@/components/ImageComponents/CustomImage';
2 | import imagePath from '@/app/imagePath';
3 | import { useRouter } from 'next/navigation';
4 |
5 | interface BackButtonProps {
6 | id: string;
7 | url: string;
8 | }
9 |
10 | export default function BackButton({ id, url }: BackButtonProps) {
11 | const router = useRouter();
12 |
13 | return (
14 | router.push(url)}
20 | >
21 |
26 |
27 | Back
28 |
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/gui/src/components/CustomContainers/container.module.css:
--------------------------------------------------------------------------------
1 | .container_section {
2 | display: flex;
3 | flex-direction: column;
4 | width: 100%;
5 | position: relative;
6 | border-radius: 8px;
7 | border: 1px solid var(--white-opacity-8);
8 | background: var(--layout-bg-color);
9 | }
10 |
11 | .container_header {
12 | color: #888;
13 | font-family: 'Proxima Nova', sans-serif;
14 | font-size: 14px;
15 | font-style: normal;
16 | font-weight: 400;
17 | line-height: normal;
18 | padding: 8px 12px;
19 | border-bottom: 1px solid var(--white-opacity-8);
20 | background: var(--layout-bg-color);
21 | border-radius: 8px 8px 0 0;
22 | }
23 |
24 | .container_tab_header {
25 | display: flex;
26 | flex-direction: row;
27 | gap: 4px;
28 | padding: 8px;
29 | border-bottom: 1px solid var(--white-opacity-8);
30 | cursor: pointer;
31 | }
32 |
33 | .tab_item, .tab_item_selected {
34 | display: flex;
35 | flex-direction: row;
36 | align-items: center;
37 | justify-content: center;
38 | padding: 4px 8px;
39 | gap: 8px;
40 | border-radius: 8px;
41 | }
42 |
43 | .tab_item_selected {
44 | background: rgb(255 255 255 / 6%);
45 | }
46 |
--------------------------------------------------------------------------------
/gui/src/components/CustomDiffEditor/diff.module.css:
--------------------------------------------------------------------------------
1 | .diff_container {
2 | display: flex;
3 | flex-direction: column;
4 | align-items: flex-start;
5 | align-self: stretch;
6 | border-radius: 8px;
7 | border: 1px solid var(--white-opacity-8);
8 | margin-bottom: 20px;
9 | }
10 |
11 | .diff_header {
12 | display: flex;
13 | flex-direction: row;
14 | align-items: center;
15 | gap: 8px;
16 | padding: 12px 10px;
17 | background: var(--white-opacity-8);
18 | color: #fff;
19 | width: 100%;
20 | font-family: 'Space Mono', sans-serif;
21 | font-size: 12px;
22 | font-style: normal;
23 | font-weight: 400;
24 | line-height: normal;
25 | }
26 |
27 | .border_radius_top {
28 | border-radius: 7px 7px 0 0;
29 | }
30 |
--------------------------------------------------------------------------------
/gui/src/components/CustomLoaders/CustomLoaders.tsx:
--------------------------------------------------------------------------------
1 | import styles from './loader.module.css';
2 | import SkeletonLoader from '@/components/CustomLoaders/SkeletonLoader';
3 | import skeletonLoader from '@/components/CustomLoaders/SkeletonLoader';
4 |
5 | interface CustomLoadersProps {
6 | type: string;
7 | size?: number;
8 | skeletonType?: string;
9 | }
10 |
11 | export default function CustomLoaders({
12 | type,
13 | size,
14 | skeletonType,
15 | }: CustomLoadersProps) {
16 | return (
17 |
18 | {type === 'default' ? (
19 |
23 | ) : (
24 |
25 | )}
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/gui/src/components/CustomLoaders/Loader.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './loader.module.css';
3 |
4 | interface LoaderProps {
5 | size?: number;
6 | text?: string;
7 | }
8 |
9 | const Loader: React.FC = ({ size = 100, text = 'Loading...' }) => {
10 | return (
11 |
20 | );
21 | };
22 |
23 | export default Loader;
24 |
--------------------------------------------------------------------------------
/gui/src/components/CustomSidebar/sidebar.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | }
4 |
5 | .sidebar {
6 | width: 250px;
7 | padding: 10px;
8 | display: flex;
9 | flex-direction: column;
10 | gap: 16px;
11 | }
12 |
13 | .sidebar_title {
14 | font-family: "Proxima Nova", sans-serif;
15 | font-size: 16px;
16 | font-style: normal;
17 | font-weight: 600;
18 | line-height: normal;
19 | color: var(--foreground-rgb);
20 | }
21 |
22 | .option {
23 | display: flex;
24 | padding: 8px;
25 | align-items: center;
26 | gap: 4px;
27 | align-self: stretch;
28 | border-radius: 8px;
29 | cursor: pointer;
30 | color: #FFF;
31 | font-family: "Proxima Nova", sans-serif;
32 | font-size: 14px;
33 | font-style: normal;
34 | font-weight: 400;
35 | transition: background-color 0.2s ease-in-out;
36 | }
37 |
38 | .option:hover {
39 | background-color: var(--white-opacity-12);
40 | }
41 |
42 | .active {
43 | background-color: var(--white-opacity-12);
44 | }
45 |
46 | .content {
47 | flex-grow: 1;
48 | padding: 10px;
49 | }
--------------------------------------------------------------------------------
/gui/src/components/CustomTag/CustomTag.tsx:
--------------------------------------------------------------------------------
1 | import CustomImage from '@/components/ImageComponents/CustomImage';
2 | import { CustomTagProps } from '../../../types/customComponentTypes';
3 | import styles from './tag.module.css';
4 |
5 | export default function CustomTag({
6 | text,
7 | icon,
8 | iconClass,
9 | iconBack,
10 | iconBackClass,
11 | color = 'grey',
12 | children,
13 | className = 'rounded-3xl',
14 | }: CustomTagProps) {
15 | const tagCSS = {
16 | grey: styles.grey_tag,
17 | purple: styles.purple_tag,
18 | yellow: styles.yellow_tag,
19 | green: styles.green_tag,
20 | red: styles.red_tag,
21 | };
22 |
23 | return (
24 |
28 | {icon && (
29 |
34 | )}
35 | {text}
36 | {children}
37 | {iconBack && (
38 |
43 | )}
44 |
45 | );
46 | }
47 |
--------------------------------------------------------------------------------
/gui/src/components/CustomTag/tag.module.css:
--------------------------------------------------------------------------------
1 | .grey_tag,
2 | .purple_tag,
3 | .green_tag,
4 | .red_tag,
5 | .yellow_tag{
6 | display: flex;
7 | padding: 6px 8px;
8 | align-items: center;
9 | gap: 4px;
10 | color: #fff;
11 | font-family: 'Proxima Nova', sans-serif;
12 | font-size: 13px;
13 | font-style: normal;
14 | font-weight: 500;
15 | line-height: normal;
16 | }
17 |
18 | .grey_tag {
19 | /* To Do Tag */
20 | background: #474747;
21 | }
22 |
23 | .purple_tag {
24 | /* In Progress Tag */
25 | background: #A05BD5;
26 | }
27 |
28 | .yellow_tag {
29 | /* In Review */
30 | background: #AA7C23;
31 | }
32 |
33 | .green_tag {
34 | /* Done Tag */
35 | background: linear-gradient(0deg, rgb(0 0 0 / 40%) 0%, rgb(0 0 0 / 40%) 100%),
36 | #4bac1c;
37 | }
38 |
39 | .red_tag{
40 | background: #6d2a29;
41 | }
42 |
--------------------------------------------------------------------------------
/gui/src/components/CustomTimeline/CustomTimeline.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './timeline.module.css';
3 |
4 | interface TimelineItem {
5 | id: number;
6 | content: string;
7 | timestamp: string;
8 | }
9 |
10 | interface CustomTimelineProps {
11 | items: TimelineItem[];
12 | }
13 |
14 | export default function CustomTimeline({ items }: CustomTimelineProps) {
15 | return (
16 |
20 |
21 | {items.map((item) => (
22 |
23 |
24 |
25 | {item.content}
26 |
{item.timestamp}
27 |
28 |
29 | ))}
30 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/gui/src/components/CustomTimeline/timeline.module.css:
--------------------------------------------------------------------------------
1 | .timeline_container {
2 | display: flex;
3 | flex-direction: column;
4 | align-items: flex-start;
5 | overflow-y: auto;
6 | height: 100%;
7 | width: 100%;
8 | padding: 20px;
9 | position: relative;
10 | }
11 |
12 | .line {
13 | position: absolute;
14 | top: 0;
15 | bottom: 0;
16 | left: 20px;
17 | width: 2px;
18 | background-color: #555;
19 | z-index: 1;
20 | }
21 |
22 | .timeline_item_container {
23 | display: flex;
24 | align-items: flex-start;
25 | margin: 20px 0;
26 | position: relative;
27 | padding-left: 20px;
28 | z-index: 2;
29 | }
30 |
31 | .bullet {
32 | width: 8px;
33 | height: 8px;
34 | background-color: #888;
35 | border-radius: 50%;
36 | position: absolute;
37 | left: -3px;
38 | top: 6px;
39 | z-index: 3;
40 | }
41 |
42 | .content {
43 | background-color: #2e2e2e;
44 | color: #cfcfcf;
45 | padding: 10px 15px;
46 | border-radius: 5px;
47 | word-wrap: break-word;
48 | box-shadow: 0 0 10px rgb(0 0 0 / 50%);
49 | border-left: 3px solid #555;
50 | }
51 |
52 | .timestamp {
53 | margin-left: 10px;
54 | color: #888;
55 | font-size: 0.8em;
56 | align-self: flex-end;
57 | }
58 |
--------------------------------------------------------------------------------
/gui/src/components/HomeComponents/home.module.css:
--------------------------------------------------------------------------------
1 | .bg_color {
2 | border-radius: 10px;
3 | background: var(--layout-bg-color);
4 | backdrop-filter: blur(50px);
5 | }
6 |
7 | .card_container {
8 | border-radius: 8px;
9 | background: var(--white-opacity-4);
10 | }
11 |
12 | .gradient_effect {
13 | position: absolute;
14 | border-radius: 424px;
15 | background: var(--landing-page-gradient-color);
16 | filter: blur(220px);
17 | width: 300px;
18 | height: 240px;
19 | top: -100px;
20 | }
21 |
22 | .divider {
23 | background: var(--white-opacity-8);
24 | }
--------------------------------------------------------------------------------
/gui/src/components/ImageComponents/CustomImage.tsx:
--------------------------------------------------------------------------------
1 | import Image from 'next/image';
2 | import { CustomImageProps } from '../../../types/imageComponentsTypes';
3 |
4 | export default function CustomImage({
5 | className,
6 | src,
7 | alt,
8 | priority = false,
9 | onClick,
10 | }: CustomImageProps) {
11 | return (
12 |
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/gui/src/components/ImageComponents/CustomTextImage.tsx:
--------------------------------------------------------------------------------
1 | import { CustomTextImageProps } from '../../../types/imageComponentsTypes';
2 | import CustomImage from '@/components/ImageComponents/CustomImage';
3 |
4 | export default function CustomTextImage({
5 | gap,
6 | textCSS,
7 | text,
8 | imageCSS,
9 | src,
10 | alt,
11 | priority,
12 | }: CustomTextImageProps) {
13 | return (
14 |
15 |
21 | {text}
22 |
23 | );
24 | }
25 |
--------------------------------------------------------------------------------
/gui/src/components/ImageComponents/image.module.css:
--------------------------------------------------------------------------------
1 | .image_option_selected {
2 | border-radius: 12px;
3 | border: 2.296px solid var(--selected-image-border-color);
4 | cursor: pointer;
5 | transition: opacity 0.3s ease-in-out;
6 | }
7 |
8 | .image_option {
9 | opacity: 0.4;
10 | transition: opacity 0.3s ease-in-out;
11 | }
12 |
--------------------------------------------------------------------------------
/gui/src/components/LayoutComponents/style.css:
--------------------------------------------------------------------------------
1 | .navbar {
2 | background-color: var(--layout-bg-color);
3 | color: white;
4 | height: 50px;
5 | display: flex;
6 | flex-direction: row;
7 | align-items: center;
8 | padding: 8px;
9 | }
10 |
11 | .sidebar {
12 | background-color: var(--layout-bg-color);
13 | padding: 4px 8px;
14 | display: flex;
15 | flex-direction: column;
16 | align-items: center;
17 | gap: 8px;
18 | }
19 |
20 | .sidebar_item,
21 | .sidebar_item_selected {
22 | border-radius: 8px;
23 | display: flex;
24 | flex-direction: column;
25 | padding: 8px 10px;
26 | gap: 4px;
27 | align-self: stretch;
28 | cursor: pointer;
29 | width: 66px;
30 | }
31 |
32 | .sidebar_item_selected {
33 | background: var(--sidebar-item-selected);
34 | }
35 |
36 | .initial_circle {
37 | display: flex;
38 | width: 32px;
39 | height: 32px;
40 | padding: 0 7px;
41 | justify-content: center;
42 | align-items: center;
43 | gap: 2px;
44 | border-radius: 50px;
45 | background: rgb(255 255 255 / 20%);
46 | }
47 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/InputSection.tsx:
--------------------------------------------------------------------------------
1 | import React, { forwardRef } from 'react';
2 | import { InputSectionProps } from '../../../types/storyTypes';
3 |
4 | const InputSection = forwardRef<
5 | HTMLTextAreaElement | HTMLInputElement,
6 | InputSectionProps
7 | >(({ id, label, type = 'text', isTextArea = false, placeholder }, ref) => (
8 |
9 | {label}
10 |
11 | {isTextArea ? (
12 |
26 | ));
27 | InputSection.displayName = 'InputSection';
28 |
29 | export default InputSection;
30 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/Instructions.tsx:
--------------------------------------------------------------------------------
1 | import { StoryInstructions } from '../../../types/storyTypes';
2 |
3 | export default function Instructions({ instructions }: StoryInstructions) {
4 | return (
5 |
9 | {instructions &&
10 | instructions.length > 0 &&
11 | instructions.map((instruction, index) => (
12 |
13 | {instruction}
14 |
15 | ))}
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/Overview.tsx:
--------------------------------------------------------------------------------
1 | import { StoryOverview } from '../../../types/storyTypes';
2 |
3 | export default function Overview({ overview }: StoryOverview) {
4 | return (
5 | overview && (
6 |
10 |
11 | DESCRIPTION
12 | {overview.description}
13 |
14 |
15 | )
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/SetupModelModal.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import CustomModal from '@/components/CustomModal/CustomModal';
3 | import { Button } from '@nextui-org/react';
4 | import { useRouter } from 'next/navigation';
5 | import { SetupModelModalProps } from '../../../types/storyTypes';
6 |
7 | const SetupModelModal: React.FC = ({
8 | openModal,
9 | setOpenModel,
10 | }) => {
11 | const router = useRouter();
12 | return (
13 | setOpenModel(false)}
16 | width={'30vw'}
17 | >
18 |
19 |
20 |
21 | Set up your model to move stories to 'In Progress'
22 |
23 |
24 |
25 |
31 |
32 |
33 | );
34 | };
35 |
36 | export default SetupModelModal;
37 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/TestCases.tsx:
--------------------------------------------------------------------------------
1 | import { StoryTestCases } from '../../../types/storyTypes';
2 |
3 | export default function TestCases({ cases }: StoryTestCases) {
4 | return (
5 |
9 | {cases &&
10 | cases.length > 0 &&
11 | cases.map((test, index) => (
12 |
13 |
14 | {index + 1}. {test}
15 |
16 |
17 | ))}
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/gui/src/components/StoryComponents/story.module.css:
--------------------------------------------------------------------------------
1 | .new_story_container {
2 | display: flex;
3 | flex-direction: column;
4 | font-family: 'Proxima Nova', sans-serif;
5 | color: var(--foreground-rgb);
6 | }
7 |
8 | .new_story_header,
9 | .story_details_header {
10 | display: flex;
11 | flex-direction: row;
12 | justify-content: space-between;
13 | align-items: center;
14 | border-bottom: 1px solid var(--white-opacity-8);
15 | padding: 24px 16px;
16 | flex-shrink: 0; /* Prevent shrinking */
17 | }
18 |
19 | .new_story_body {
20 | display: flex;
21 | flex-direction: column;
22 | gap: 24px;
23 | padding: 24px 16px;
24 | overflow-y: auto;
25 | flex-grow: 1;
26 | }
27 |
28 | .new_story_footer {
29 | display: flex;
30 | padding: 16px;
31 | justify-content: flex-end;
32 | align-items: flex-start;
33 | gap: 8px;
34 | align-self: stretch;
35 | border-top: 1px solid var(--white-opacity-8);
36 | flex-shrink: 0;
37 | }
38 |
39 | .issue_container {
40 | border-left: 4px solid var(--warning-container-border);
41 | background: var(--warning-container-background);
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/gui/src/components/WorkBenchComponents/StoryDetailsWorkbench.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import StoryDetails from '@/components/StoryComponents/StoryDetails';
3 | import { StoryDetailsWorkbenchProps } from '../../../types/workbenchTypes';
4 |
5 | export default function StoryDetailsWorkbench({
6 | id,
7 | }: StoryDetailsWorkbenchProps) {
8 | return (
9 |
10 |
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/gui/src/components/WorkBenchComponents/workbenchComponents.module.css:
--------------------------------------------------------------------------------
1 | .activity_container {
2 | border-radius: 8px;
3 | background: rgb(255 255 255 / 3%);
4 | display: flex;
5 | padding: 12px;
6 | flex-direction: column;
7 | align-items: flex-start;
8 | gap: 8px;
9 | }
10 |
11 | .container_section {
12 | border: 1px solid var(--white-opacity-8);
13 | background: var(--layout-bg-color);
14 | }
15 |
16 | .container_header {
17 | border-bottom: 1px solid var(--white-opacity-8);
18 | }
19 |
--------------------------------------------------------------------------------
/gui/src/context/PullRequests.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import React, { createContext, ReactNode, useState } from 'react';
3 | import { PRListItems } from '../../types/pullRequestsTypes';
4 |
5 | interface PullRequestsContextProps {
6 | prList: PRListItems[];
7 | setPRList: React.Dispatch>;
8 | }
9 |
10 | const PullRequestsContext = createContext(
11 | undefined,
12 | );
13 |
14 | export const PullRequestsProvider: React.FC<{ children: ReactNode }> = ({
15 | children,
16 | }) => {
17 | const [prList, setPRList] = useState(null);
18 | return (
19 |
20 | {children}
21 |
22 | );
23 | };
24 |
25 | export const usePullRequestsContext = () => {
26 | const context = React.useContext(PullRequestsContext);
27 |
28 | if (!context) {
29 | throw new Error(
30 | 'usePullRequestsContext must be used within a BoardProvider',
31 | );
32 | }
33 |
34 | return context;
35 | };
36 |
--------------------------------------------------------------------------------
/gui/src/hooks/useProjectDropdown.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import { usePathname } from 'next/navigation';
3 |
4 | const ProjectHideDropdown = ['projects'];
5 |
6 | const useProjectDropdown = () => {
7 | const pathname = usePathname();
8 |
9 | return !ProjectHideDropdown.some((item) => pathname.includes(item));
10 | };
11 |
12 | export default useProjectDropdown;
13 |
--------------------------------------------------------------------------------
/gui/src/middleware.ts:
--------------------------------------------------------------------------------
1 | import { NextRequest } from 'next/server';
2 |
3 | export function middleware(request: NextRequest) {
4 | const token = request.cookies.get('token')?.value;
5 | if (!token) {
6 | if (request.nextUrl.pathname !== '/') {
7 | return Response.redirect(new URL('/', request.url));
8 | }
9 | } else {
10 | if (request.nextUrl.pathname === '/') {
11 | return Response.redirect(new URL('/projects', request.url));
12 | }
13 | }
14 | }
15 |
16 | export const config = {
17 | matcher: ['/', '/workbench', '/board', '/code', '/pull_request', '/projects'],
18 | };
19 |
--------------------------------------------------------------------------------
/gui/src/utils/SocketUtils.tsx:
--------------------------------------------------------------------------------
1 | import { Socket } from 'net';
2 |
3 | export const handleStartWorkspace = (
4 | socket: Socket | null,
5 | projectId: string,
6 | ) => {
7 | return new Promise((resolve) => {
8 | if (socket) {
9 | socket.emit('workspace-start', { project_id: projectId });
10 | socket.on('workspace-started', (message: string) => {
11 | console.log(message);
12 | resolve();
13 | });
14 | } else {
15 | resolve();
16 | }
17 | });
18 | };
19 |
20 | export const handleCloseWorkspace = (
21 | socket: Socket | null,
22 | projectId: string | null,
23 | disconnectSocket?: () => void,
24 | ) => {
25 | return new Promise((resolve) => {
26 | if (socket && projectId) {
27 | socket.emit('workspace-close', { project_id: projectId });
28 | socket.on('workspace-closed', (message: string) => {
29 | console.log(message);
30 | resolve();
31 | });
32 | } else {
33 | resolve();
34 | }
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/gui/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from 'tailwindcss';
2 | import { nextui } from '@nextui-org/react';
3 |
4 | const config: Config = {
5 | content: [
6 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
7 | './src/components/**/*.{js,ts,jsx,tsx,mdx}',
8 | './src/app/**/*.{js,ts,jsx,tsx,mdx}',
9 | './node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}',
10 | ],
11 | theme: {
12 | extend: {
13 | backgroundImage: {
14 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
15 | 'gradient-conic':
16 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
17 | },
18 | },
19 | },
20 | darkMode: 'class',
21 | plugins: [nextui()],
22 | };
23 | export default config;
24 |
--------------------------------------------------------------------------------
/gui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": false,
7 | "noEmit": true,
8 | "esModuleInterop": true,
9 | "module": "esnext",
10 | "moduleResolution": "bundler",
11 | "resolveJsonModule": true,
12 | "isolatedModules": true,
13 | "jsx": "preserve",
14 | "incremental": true,
15 | "plugins": [
16 | {
17 | "name": "next"
18 | },
19 | {
20 | "name": "typescript-plugin-css-modules"
21 | }
22 | ],
23 | "paths": {
24 | "@/*": ["./src/*"]
25 | }
26 | },
27 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
28 | "exclude": ["node_modules"]
29 | }
--------------------------------------------------------------------------------
/gui/types/authTypes.ts:
--------------------------------------------------------------------------------
1 | export interface authPayload {
2 | email: string;
3 | password: string;
4 | }
5 |
6 | export interface UserData {
7 | id: number;
8 | email: string;
9 | name: string;
10 | organisation_id: number;
11 | }
12 |
--------------------------------------------------------------------------------
/gui/types/designStoryTypes.ts:
--------------------------------------------------------------------------------
1 | export interface DesignStoryItem {
2 | id: number;
3 | status: string;
4 | reason: string;
5 | title: string;
6 | input_file_url: string;
7 | created_on: string;
8 | review_viewed: boolean;
9 | }
10 |
11 | export interface CreateEditDesignStoryProps {
12 | id: string;
13 | top: string;
14 | close: () => void;
15 | toGetAllDesignStoriesOfProject?: () => void;
16 | }
17 |
18 | export interface DesignStoryDetailsProps {
19 | id: string;
20 | top: string;
21 | close: () => void;
22 | toGetAllDesignStoriesOfProject: () => void;
23 | setOpenSetupModelModal: React.Dispatch>;
24 | numberOfStoriesInProgress: number;
25 | }
26 |
27 | export interface CreateDesignStoryPayload {
28 | project_id: string;
29 | title: string;
30 | file: Blob;
31 | imageName: string;
32 | }
33 |
34 | export interface EditDesignStoryPayload {
35 | story_id: number;
36 | title: string;
37 | file: Blob;
38 | imageName: string;
39 | }
40 |
41 | export interface DesignStoryInReviewIssue {
42 | title: string | null;
43 | description: string | null;
44 | actions: { label: string; link: string }[];
45 | }
46 |
--------------------------------------------------------------------------------
/gui/types/imageComponentsTypes.ts:
--------------------------------------------------------------------------------
1 | export interface CustomImageProps {
2 | className: string;
3 | src: string;
4 | alt: string;
5 | priority?: boolean;
6 | onClick?: () => void;
7 | }
8 |
9 | export interface CustomTextImageProps {
10 | gap: string;
11 | textCSS: string;
12 | text: string;
13 | imageCSS: string;
14 | src: string;
15 | alt: string;
16 | priority?: boolean;
17 | }
18 |
19 | export interface ImageOptions {
20 | id: string;
21 | src: string;
22 | text: string;
23 | available: boolean;
24 | }
25 |
26 | export interface CustomImageSelectorProps {
27 | size: string;
28 | gap: string;
29 | imageOptions: ImageOptions[];
30 | selectedOption: string;
31 | onSelectOption: (id: string) => void;
32 | }
33 |
--------------------------------------------------------------------------------
/gui/types/modelsTypes.ts:
--------------------------------------------------------------------------------
1 | export interface LLMAPIKey {
2 | llm_model: string;
3 | llm_api_key: string;
4 | }
5 |
6 | export interface CreateOrUpdateLLMAPIKeyPayload {
7 | api_keys: LLMAPIKey[];
8 | }
9 |
--------------------------------------------------------------------------------
/gui/types/navbarTypes.ts:
--------------------------------------------------------------------------------
1 | export interface NavbarTypes {
2 | id: string;
3 | text: string;
4 | image: string;
5 | url: string;
6 | }
7 |
--------------------------------------------------------------------------------
/gui/types/projectsTypes.ts:
--------------------------------------------------------------------------------
1 | export interface CreateProjectPayload {
2 | name: string;
3 | framework: string;
4 | frontend_framework: string;
5 | description: string;
6 | }
7 |
8 | export interface UpdateProjectPayload {
9 | project_id: number;
10 | name: string;
11 | description: string;
12 | }
13 |
14 | export interface ProjectTypes {
15 | project_id: number;
16 | project_name: string;
17 | project_description: string;
18 | project_hash_id: string;
19 | project_url: string;
20 | project_backend_url: string;
21 | project_frontend_url: string;
22 | pull_request_count: number;
23 | project_framework: string;
24 | project_frontend_framework: string;
25 | }
26 |
--------------------------------------------------------------------------------
/gui/types/settingTypes.ts:
--------------------------------------------------------------------------------
1 | export interface ModelsList {
2 | model_name: string;
3 | api_key: string;
4 | text?: string;
5 | icon?: string;
6 | }
7 |
--------------------------------------------------------------------------------
/gui/types/sidebarTypes.ts:
--------------------------------------------------------------------------------
1 | export interface SidebarOption {
2 | id: string;
3 | text: string;
4 | selected: string;
5 | unselected: string;
6 | route: string;
7 | }
8 |
--------------------------------------------------------------------------------
/gui/types/workbenchTypes.ts:
--------------------------------------------------------------------------------
1 | export interface StoryDetailsWorkbenchProps {
2 | id: string | number;
3 | }
4 |
5 | export interface StoryListItems {
6 | story_id: number;
7 | story_name: string;
8 | }
9 |
10 | export interface StoryList {
11 | IN_PROGRESS: StoryListItems[];
12 | IN_REVIEW: StoryListItems[];
13 | DONE: StoryListItems[];
14 | }
15 |
16 | export interface BrowserProps {
17 | url: string;
18 | status?: boolean;
19 | showUrl?: boolean;
20 | }
21 |
22 | export interface ActivityItem {
23 | LogMessage: string;
24 | Type: string;
25 | CreatedAt: string;
26 | }
27 |
28 | export interface ActiveWorkbenchProps {
29 | storiesList: StoryList;
30 | storyType: string;
31 | }
32 |
33 | export interface BackendWorkbenchProps {
34 | activityLogs: ActivityItem[];
35 | selectedStoryId: string | number;
36 | status: boolean;
37 | }
38 |
39 | export interface DesignWorkbenchProps {
40 | activityLogs: ActivityItem[];
41 | selectedStoryId: string;
42 | executionInProcess: boolean;
43 | }
44 |
--------------------------------------------------------------------------------
/ide/node/config.yaml:
--------------------------------------------------------------------------------
1 | bind-addr: 0.0.0.0:8080
2 | auth: none
3 | cert: false
4 |
--------------------------------------------------------------------------------
/ide/node/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "security.workspace.trust.startupPrompt": "never",
3 | "security.workspace.trust.enabled": false,
4 | "security.workspace.trust.banner": "never",
5 | "workbench.activityBar.location": "hidden",
6 | "workbench.colorTheme": "Default Dark Modern",
7 | "workbench.statusBar.visible": false,
8 | "terminal.integrated.defaultProfile.linux": "bash",
9 | "terminal.integrated.fontWeight": "normal",
10 | "terminal.integrated.hideOnStartup": "never",
11 | "workbench.startupEditor": "terminal",
12 | "workbench.colorCustomizations": {
13 | "sideBar.background": "#131315",
14 | "sideBarSectionHeader.background": "#131315",
15 | "editor.background": "#151518",
16 | "activityBar.activeBorder": "#7c87e6",
17 | "activityBar.background": "#151518",
18 | "menu.background": "#131315",
19 | "titleBar.activeBackground": "#131315",
20 | "terminal.background": "#131315",
21 | "tab.activeBorderTop": "#7c87e6",
22 | "tab.activeBackground": "#151518",
23 | "tab.inactiveBackground": "#131315",
24 | "panelTitle.activeBorder": "#7c87e6"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ide/python/config.yaml:
--------------------------------------------------------------------------------
1 | bind-addr: 0.0.0.0:8080
2 | auth: none
3 | cert: false
4 |
--------------------------------------------------------------------------------
/ide/python/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "security.workspace.trust.startupPrompt": "never",
3 | "security.workspace.trust.enabled": false,
4 | "security.workspace.trust.banner": "never",
5 | "workbench.activityBar.location": "hidden",
6 | "workbench.colorTheme": "Default Dark Modern",
7 | "workbench.statusBar.visible": false,
8 | "terminal.integrated.defaultProfile.linux": "bash",
9 | "terminal.integrated.fontWeight": "normal",
10 | "terminal.integrated.hideOnStartup": "never",
11 | "workbench.startupEditor": "terminal",
12 | "workbench.colorCustomizations": {
13 | "sideBar.background": "#131315",
14 | "sideBarSectionHeader.background": "#131315",
15 | "editor.background": "#151518",
16 | "activityBar.activeBorder": "#7c87e6",
17 | "activityBar.background": "#151518",
18 | "menu.background": "#131315",
19 | "titleBar.activeBackground": "#131315",
20 | "terminal.background": "#131315",
21 | "tab.activeBorderTop": "#7c87e6",
22 | "tab.activeBackground": "#151518",
23 | "tab.inactiveBackground": "#131315",
24 | "panelTitle.activeBorder": "#7c87e6"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/startup-worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #check if AI_DEVELOPER_GITNESS_TOKEN is set and if not set it continue else exit
4 | if [ -z "$AI_DEVELOPER_GITNESS_TOKEN" ]; then
5 | echo "AI_DEVELOPER_GITNESS_TOKEN is not set"
6 | while true; do
7 | curl -s gitness:3000/ > /dev/null
8 | if [ $? -eq 0 ]; then
9 | break
10 | fi
11 | sleep 1
12 | done
13 |
14 | echo "Gitness is up"
15 |
16 | data=$(jq -n --arg login_identifier "$AI_DEVELOPER_GITNESS_USER" --arg password "$AI_DEVELOPER_GITNESS_PASSWORD" '{login_identifier: $login_identifier, password: $password}')
17 |
18 | login_token=$(curl -X 'POST' 'http://gitness:3000/api/v1/login?include_cookie=false' -H 'accept: application/json' -H 'Content-Type: application/json' -d "$data" | jq -r '.access_token')
19 |
20 | current_date=$(date +%s)
21 | data=$(jq -n --arg identifier "$current_date" '{identifier: $identifier, lifetime: 604800000000000}')
22 |
23 |
24 | access_token=$(curl -X 'POST' 'http://gitness:3000/api/v1/user/tokens' -H 'accept: application/json' -H 'Content-Type: application/json' -H "Cookie: token=$login_token" -d "$data" | jq -r '.access_token')
25 | export AI_DEVELOPER_GITNESS_TOKEN=$access_token
26 | else
27 | echo "AI_DEVELOPER_GITNESS_TOKEN is set"
28 | fi
29 |
30 | go run worker.go
--------------------------------------------------------------------------------
/workspace-service/.gitignore:
--------------------------------------------------------------------------------
1 | ### Go template
2 | # If you prefer the allow list template instead of the deny list, see community template:
3 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
4 | #
5 | # Binaries for programs and plugins
6 | *.exe
7 | *.exe~
8 | *.dll
9 | *.so
10 | *.dylib
11 |
12 | # Test binary, built with `go test -c`
13 | *.test
14 |
15 | # Output of the go coverage tool, specifically when used with LiteIDE
16 | *.out
17 |
18 | # Dependency directories (remove the comment below to include it)
19 | # vendor/
20 |
21 | # Go workspace file
22 | go.work
23 |
24 | *.iml
25 | .idea/
26 |
--------------------------------------------------------------------------------
/workspace-service/app/clients/docker_client.go:
--------------------------------------------------------------------------------
1 | package clients
2 |
3 | import (
4 | "github.com/docker/docker/client"
5 | "go.uber.org/zap"
6 | )
7 |
8 | func NewDockerClient(logger *zap.Logger) (apiClient *client.Client, err error) {
9 | apiClient, err = client.NewClientWithOpts(client.FromEnv)
10 | if err != nil {
11 | logger.Error("Failed to create docker client", zap.Error(err))
12 | panic(err)
13 | }
14 | return
15 | }
16 |
--------------------------------------------------------------------------------
/workspace-service/app/clients/k8s_client.go:
--------------------------------------------------------------------------------
1 | package clients
2 |
3 | import (
4 | "go.uber.org/zap"
5 | "k8s.io/client-go/kubernetes"
6 | "k8s.io/client-go/rest"
7 | )
8 |
9 | func NewK8sClientSet(logger *zap.Logger) (clientset *kubernetes.Clientset, err error) {
10 | config, err := rest.InClusterConfig()
11 | if err != nil {
12 | logger.Error("Failed to get in-cluster config", zap.Error(err))
13 | return
14 | }
15 | clientset, err = kubernetes.NewForConfig(config)
16 | return
17 | }
18 |
--------------------------------------------------------------------------------
/workspace-service/app/clients/k8s_controller_client.go:
--------------------------------------------------------------------------------
1 | package clients
2 |
3 | import (
4 | "go.uber.org/zap"
5 | "k8s.io/client-go/rest"
6 | "sigs.k8s.io/controller-runtime/pkg/client"
7 | )
8 |
9 | func NewK8sControllerClient(logger *zap.Logger) (controllerClient client.Client, err error) {
10 | restConfig, err := rest.InClusterConfig()
11 | if err != nil {
12 | logger.Error("Failed to get in-cluster config", zap.Error(err))
13 | return
14 | }
15 | controllerClient, err = client.New(restConfig, client.Options{})
16 | return
17 | }
18 |
--------------------------------------------------------------------------------
/workspace-service/app/config/env.go:
--------------------------------------------------------------------------------
1 | package config
2 |
3 | import "github.com/knadh/koanf/v2"
4 |
5 | type EnvConfig struct {
6 | config *koanf.Koanf
7 | }
8 |
9 | func (c *EnvConfig) GetEnv() string {
10 | return c.config.String("env")
11 | }
12 |
13 | func (c *EnvConfig) IsDev() bool {
14 | return c.config.String("env") == "dev"
15 | }
16 |
17 | func NewEnvConfig(config *koanf.Koanf) *EnvConfig {
18 | return &EnvConfig{config: config}
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/workspace-service/app/config/frontend_workspace_config.go:
--------------------------------------------------------------------------------
1 | package config
2 |
3 | import (
4 | "fmt"
5 | "path/filepath"
6 | "github.com/knadh/koanf/v2"
7 | )
8 |
9 | type FrontendWorkspaceConfig struct {
10 | config *koanf.Koanf
11 | }
12 |
13 | func (c *FrontendWorkspaceConfig) FrontendWorkspacePath(projectHashID string, storyHashId string) string{
14 | output := filepath.Join("/workspaces", projectHashID, "frontend" , ".stories" , storyHashId)
15 | fmt.Println("___frontend workspace service____",output)
16 | return output
17 | }
18 |
19 | func NewFrontendWorkspaceConfig(config *koanf.Koanf) *FrontendWorkspaceConfig {
20 | return &FrontendWorkspaceConfig{config: config}
21 | }
22 |
--------------------------------------------------------------------------------
/workspace-service/app/config/new_relic.go:
--------------------------------------------------------------------------------
1 | package config
2 |
3 | import "github.com/knadh/koanf/v2"
4 |
5 | type NewRelicConfig struct {
6 | config *koanf.Koanf
7 | }
8 |
9 | func (c *NewRelicConfig) LicenseKey() string {
10 | return c.config.String("newrelic.license.key")
11 | }
12 |
13 | func (c *NewRelicConfig) AppName() string {
14 | return c.config.String("newrelic.app.name")
15 | }
16 |
17 | func NewNewRelicConfig(config *koanf.Koanf) *NewRelicConfig {
18 | return &NewRelicConfig{config: config}
19 | }
20 |
--------------------------------------------------------------------------------
/workspace-service/app/config/workspace_jobs.go:
--------------------------------------------------------------------------------
1 | package config
2 |
3 | import "github.com/knadh/koanf/v2"
4 |
5 | type WorkspaceJobs struct {
6 | config *koanf.Koanf
7 | }
8 |
9 | func (c *WorkspaceJobs) ContainerImage(imageName string) string {
10 | return c.config.String("jobs.images." + imageName)
11 | }
12 |
13 | func (c *WorkspaceJobs) LocalContainerImage(imageName string) string {
14 | return c.config.String("jobs.local.images." + imageName)
15 | }
16 |
17 | func (c *WorkspaceJobs) DockerNetwork() string {
18 | return c.config.String("jobs.docker.network")
19 | }
20 |
21 | func (c *WorkspaceJobs) AutoRemoveJobContainer() bool {
22 | return c.config.String("jobs.local.autoremove") == "true"
23 | }
24 |
25 | func (c *WorkspaceJobs) VolumeSource() string {
26 | return c.config.String("jobs.local.volume.source")
27 | }
28 |
29 | func (c *WorkspaceJobs) VolumeTarget() string {
30 | return c.config.String("jobs.local.volume.target")
31 | }
32 |
33 | func (c *WorkspaceJobs) FilestoreSource() string {
34 | return c.config.String("jobs.local.filestore.source")
35 | }
36 |
37 | func (c *WorkspaceJobs) FilestoreTarget() string {
38 | return c.config.String("jobs.local.filestore.target")
39 | }
40 |
41 | func NewWorkspaceJobs(config *koanf.Koanf) *WorkspaceJobs {
42 | return &WorkspaceJobs{config: config}
43 | }
44 |
--------------------------------------------------------------------------------
/workspace-service/app/config/workspace_service.go:
--------------------------------------------------------------------------------
1 | package config
2 |
3 | import "github.com/knadh/koanf/v2"
4 |
5 | type WorkspaceServiceConfig struct {
6 | config *koanf.Koanf
7 | }
8 |
9 | func (c *WorkspaceServiceConfig) GitnessAuthUsername() string {
10 |
11 | return c.config.String("gitness.user")
12 | }
13 |
14 | func (c *WorkspaceServiceConfig) GitnessAuthToken() string {
15 | return c.config.String("gitness.token")
16 | }
17 |
18 | func (c *WorkspaceServiceConfig) WorkspaceHostName() string {
19 | return c.config.String("host")
20 | }
21 |
22 | func (c *WorkspaceServiceConfig) WorkspaceNamespace() string {
23 | return c.config.String("namespace")
24 | }
25 |
26 | func (c *WorkspaceServiceConfig) WorkspaceValuesFileName() string {
27 | return c.config.String("values.file")
28 | }
29 |
30 | func (c *WorkspaceServiceConfig) WorkspaceProject() string {
31 | return c.config.String("project")
32 | }
33 |
34 | func (c *WorkspaceServiceConfig) ArgoRepoUrl() string {
35 | return c.config.String("argo.repo.url")
36 | }
37 |
38 | func NewWorkspaceService(config *koanf.Koanf) *WorkspaceServiceConfig {
39 | return &WorkspaceServiceConfig{config: config}
40 | }
41 |
--------------------------------------------------------------------------------
/workspace-service/app/controllers/health_controller.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import "github.com/gin-gonic/gin"
4 |
5 | type HealthController struct {
6 | }
7 |
8 | func (h *HealthController) Health(c *gin.Context) {
9 | c.JSON(200, gin.H{
10 | "message": "healthy",
11 | })
12 | }
13 |
14 | func NewHealthController() *HealthController {
15 | return &HealthController{}
16 | }
17 |
--------------------------------------------------------------------------------
/workspace-service/app/controllers/jobs_controller.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import (
4 | "github.com/gin-gonic/gin"
5 | "go.uber.org/zap"
6 | "workspace-service/app/models/dto"
7 | "workspace-service/app/services"
8 | )
9 |
10 | type JobsController struct {
11 | jobService services.JobService
12 | logger *zap.Logger
13 | }
14 |
15 | func (wc *JobsController) CreateWorkspace(c *gin.Context) {
16 | body := dto.CreateJobRequest{
17 | ExecutorImage: "python",
18 | }
19 |
20 | if err := c.BindJSON(&body); err != nil {
21 | wc.logger.Error("Failed to bind json", zap.Error(err))
22 | c.AbortWithStatusJSON(400, gin.H{
23 | "error": "Bad Request",
24 | })
25 | return
26 | }
27 |
28 | jobDetails, err := wc.jobService.CreateJob(body)
29 | if err != nil {
30 | wc.logger.Error("Failed to create job", zap.Error(err))
31 | c.AbortWithStatusJSON(
32 | 500,
33 | gin.H{"error": "Internal Server Error"},
34 | )
35 | return
36 | }
37 |
38 | c.JSON(
39 | 200,
40 | gin.H{"message": "success", "job": jobDetails},
41 | )
42 | }
43 |
44 | func NewJobsController(
45 | logger *zap.Logger,
46 | jobsService services.JobService,
47 | ) *JobsController {
48 | return &JobsController{
49 | jobService: jobsService,
50 | logger: logger,
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/workspace-service/app/models/dto/create_job.go:
--------------------------------------------------------------------------------
1 | package dto
2 |
3 | type CreateJobRequest struct {
4 | ExecutionId int64 `json:"executionId"`
5 | ProjectId string `json:"projectId"`
6 | StoryId int64 `json:"storyId"`
7 | IsReExecution bool `json:"isReExecution"`
8 | Branch string `json:"branch"`
9 | PullRequestId int64 `json:"pullRequestId"`
10 | ExecutorImage string `json:"executorImage"`
11 | Env []string `json:"env"`
12 | WorkspaceMountPath string `json:"workspaceMountPath"`
13 | }
14 |
15 | type CreateJobResponse struct {
16 | JobId string `json:"jobId"`
17 | }
18 |
--------------------------------------------------------------------------------
/workspace-service/app/models/dto/create_workspace.go:
--------------------------------------------------------------------------------
1 | package dto
2 |
3 | type CreateWorkspace struct {
4 | StoryHashId string `json:"storyHashId"`
5 | WorkspaceId string `json:"workspaceId"`
6 | RemoteURL string `json:"remoteURL"`
7 | FrontendTemplate *string `json:"frontendTemplate,omitempty"`
8 | BackendTemplate *string `json:"backendTemplate,omitempty"`
9 | GitnessUserName string `json:"gitnessUserName,omitempty"`
10 | GitnessToken string `json:"gitnessToken,omitempty"`
11 | }
12 |
--------------------------------------------------------------------------------
/workspace-service/app/models/dto/workspace_details.go:
--------------------------------------------------------------------------------
1 | package dto
2 |
3 | type WorkspaceDetails struct {
4 | WorkspaceId string `json:"workspaceId"`
5 | BackendTemplate *string `json:"backendTemplate,omitempty"`
6 | FrontendTemplate *string `json:"frontendTemplate,omitempty"`
7 | WorkspaceUrl *string `json:"workspaceUrl,omitempty"`
8 | FrontendUrl *string `json:"frontendUrl,omitempty"`
9 | BackendUrl *string `json:"backendUrl,omitempty"`
10 | }
11 |
--------------------------------------------------------------------------------
/workspace-service/app/services/job_service.go:
--------------------------------------------------------------------------------
1 | package services
2 |
3 | import "workspace-service/app/models/dto"
4 |
5 | type JobService interface {
6 | CreateJob(request dto.CreateJobRequest) (*dto.CreateJobResponse, error)
7 | }
8 |
--------------------------------------------------------------------------------
/workspace-service/app/services/workspace_service.go:
--------------------------------------------------------------------------------
1 | package services
2 |
3 | import "workspace-service/app/models/dto"
4 |
5 | type WorkspaceService interface {
6 | CreateWorkspace(workspaceId string, backendTemplate string, frontendTemplate *string, remoteURL string, gitnessUser string, gitnessToken string) (*dto.WorkspaceDetails, error)
7 | CreateFrontendWorkspace(storyHashId, workspaceId string, frontendTemplate string) (*dto.WorkspaceDetails, error)
8 | DeleteWorkspace(workspaceId string) error
9 | }
10 |
--------------------------------------------------------------------------------
/workspace-service/templates/django/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "Run Python App",
6 | "type": "shell",
7 | "command": "(ps -ef | grep 'python3 manage.py runserver 0.0.0.0:5000' | grep -v grep | awk '{print $2}' | xargs -r kill -9 || true) && python3 manage.py runserver 0.0.0.0:5000",
8 | "options": {
9 | "shell": {
10 | "executable": "/bin/bash",
11 | "args": [
12 | "-c"
13 | ]
14 | }
15 | },
16 | "isBackground": false,
17 | "problemMatcher": [],
18 | "group": {
19 | "kind": "build",
20 | "isDefault": true
21 | },
22 | "presentation": {
23 | "echo": true,
24 | "reveal": "always",
25 | "focus": false,
26 | "panel": "dedicated",
27 | "showReuseMessage": true
28 | },
29 | "runOptions": {
30 | "runOn": "folderOpen"
31 | }
32 | }
33 | ]
34 | }
--------------------------------------------------------------------------------
/workspace-service/templates/django/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/django/myapp/__init__.py
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/app.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class MyappConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'myapp'
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/django/myapp/migrations/__init__.py
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from . import views
3 |
4 | urlpatterns = [
5 | path('', views.home, name='home'),
6 | path('about/', views.about, name='about'),
7 | ]
--------------------------------------------------------------------------------
/workspace-service/templates/django/myapp/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 | from django.http import HttpResponse
3 |
4 | def home(request):
5 | return render(request, 'home.html')
6 |
7 | def about(request):
8 | return render(request, 'about.html')
--------------------------------------------------------------------------------
/workspace-service/templates/django/project/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/django/project/__init__.py
--------------------------------------------------------------------------------
/workspace-service/templates/django/project/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for project project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
15 |
16 | application = get_asgi_application()
--------------------------------------------------------------------------------
/workspace-service/templates/django/project/urls.py:
--------------------------------------------------------------------------------
1 | """
2 | URL configuration for project project.
3 |
4 | The `urlpatterns` list routes URLs to views. For more information please see:
5 | https://docs.djangoproject.com/en/5.0/topics/http/urls/
6 | Examples:
7 | Function views
8 | 1. Add an import: from my_app import views
9 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
10 | Class-based views
11 | 1. Add an import: from other_app.views import Home
12 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13 | Including another URLconf
14 | 1. Import the include() function: from django.urls import include, path
15 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16 | """
17 | from django.contrib import admin
18 | from django.urls import path, include
19 |
20 | urlpatterns = [
21 | path('admin/', admin.site.urls),
22 | path('accounts/', include('django.contrib.auth.urls')),
23 | path('', include('myapp.urls')),
24 | ]
--------------------------------------------------------------------------------
/workspace-service/templates/django/project/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for project project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
15 |
16 | application = get_wsgi_application()
--------------------------------------------------------------------------------
/workspace-service/templates/django/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "django-app"
3 | version = "0.1.0"
4 | description = ""
5 | authors = ["SuperCoder "]
6 | package-mode = false
7 |
8 | [tool.poetry.dependencies]
9 | python = "^3.12"
10 | Django = "5.0"
11 | setuptools = "^70.0.0"
12 |
13 | [build-system]
14 | requires = ["poetry-core"]
15 | build-backend = "poetry.core.masonry.api"
16 |
--------------------------------------------------------------------------------
/workspace-service/templates/django/server_test.txt:
--------------------------------------------------------------------------------
1 | http://0.0.0.0:5000
--------------------------------------------------------------------------------
/workspace-service/templates/django/static/css/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Arial, sans-serif;
3 | background-color: #f8f9fa;
4 | margin: 0;
5 | padding: 0;
6 | }
7 |
8 | h1 {
9 | color: #343a40;
10 | text-align: center;
11 | margin-top: 50px;
12 | }
13 |
14 | a {
15 | display: block;
16 | text-align: center;
17 | margin: 10px 0;
18 | color: #007bff;
19 | text-decoration: none;
20 | }
21 |
22 | a:hover {
23 | text-decoration: underline;
24 | }
--------------------------------------------------------------------------------
/workspace-service/templates/django/static/js/scripts.js:
--------------------------------------------------------------------------------
1 | document.addEventListener('DOMContentLoaded', function() {
2 | console.log('JavaScript loaded and ready.');
3 | // Add more JavaScript functionality here
4 | });
--------------------------------------------------------------------------------
/workspace-service/templates/django/templates/about.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 | About
7 |
8 |
9 |
10 |
11 | About Us
12 | Home
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/workspace-service/templates/django/templates/home.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 | Home
7 |
8 |
9 |
10 |
11 | Welcome to the Home Page
12 | About
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/workspace-service/templates/django/templates/registration/login.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 | Login
7 |
8 |
9 |
10 |
11 | Login
12 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/workspace-service/templates/django/terminal.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/django/terminal.txt
--------------------------------------------------------------------------------
/workspace-service/templates/flask/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "Run Python App",
6 | "type": "shell",
7 | "command": "(ps -ef | grep 'python app.py' | grep -v grep | awk '{print $2}' | xargs -r kill -9 || true) && python app.py",
8 | "options": {
9 | "shell": {
10 | "executable": "/bin/bash",
11 | "args": [
12 | "-c"
13 | ]
14 | }
15 | },
16 | "isBackground": false,
17 | "problemMatcher": [],
18 | "group": {
19 | "kind": "build",
20 | "isDefault": true
21 | },
22 | "presentation": {
23 | "echo": true,
24 | "reveal": "always",
25 | "focus": false,
26 | "panel": "dedicated",
27 | "showReuseMessage": true
28 | },
29 | "runOptions": {
30 | "runOn": "folderOpen"
31 | }
32 | }
33 | ]
34 | }
--------------------------------------------------------------------------------
/workspace-service/templates/flask/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/flask/__init__.py
--------------------------------------------------------------------------------
/workspace-service/templates/flask/app.py:
--------------------------------------------------------------------------------
1 | # This should be the only entry point of the application
2 | import os
3 | from flask import Flask
4 | from logging.config import dictConfig
5 | from models import db
6 | from flask_migrate import Migrate
7 |
8 | dictConfig({
9 | 'version': 1,
10 | 'formatters': {'default': {
11 | 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s',
12 | }},
13 | 'handlers': {'wsgi': {
14 | 'class': 'logging.StreamHandler',
15 | 'stream': 'ext://sys.stdout',
16 | 'formatter': 'default'
17 | }},
18 | 'root': {
19 | 'level': 'INFO',
20 | 'handlers': ['wsgi']
21 | }
22 | })
23 |
24 | # Initialize Flask app
25 | app = Flask(__name__, instance_path=os.path.join(os.getcwd(), 'instance'))
26 | app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
27 | app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
28 |
29 | # Initialize the database
30 | db.init_app(app)
31 |
32 | # Initialize Flask-Migrate
33 | migrate = Migrate(app, db)
34 |
35 |
36 | # Add Code Here
37 |
38 |
39 |
40 | # Run the application
41 | if __name__ == '__main__':
42 | app.run(host='0.0.0.0', port=5000, debug=True)
--------------------------------------------------------------------------------
/workspace-service/templates/flask/models/__init__.py:
--------------------------------------------------------------------------------
1 | import glob
2 | import importlib
3 | from os.path import basename, dirname, isfile, join
4 | from flask_sqlalchemy import SQLAlchemy
5 |
6 | db = SQLAlchemy()
7 |
8 | # Dynamically import all models in the models directory
9 | modules = glob.glob(join(dirname(__file__), "*.py"))
10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith("__init__.py")]
11 |
12 | for module in __all__:
13 | importlib.import_module(f"models.{module}")
14 |
--------------------------------------------------------------------------------
/workspace-service/templates/flask/models/model.py:
--------------------------------------------------------------------------------
1 | #Put your database models related code here and make more model file in this directory as needed
--------------------------------------------------------------------------------
/workspace-service/templates/flask/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "flask-app"
3 | version = "0.1.0"
4 | description = ""
5 | authors = ["SuperCoder "]
6 | package-mode = false
7 |
8 | [tool.poetry.dependencies]
9 | python = "^3.12"
10 | Flask = "^3.0.3"
11 | logging = "^0.4.9.6"
12 | flask-sqlalchemy = "^3.1.1"
13 | alembic = "^1.13.1"
14 | flask-migrate = "^4.0.7"
15 |
16 |
17 |
18 | [build-system]
19 | requires = ["poetry-core"]
20 | build-backend = "poetry.core.masonry.api"
21 |
--------------------------------------------------------------------------------
/workspace-service/templates/flask/static/css/style.css:
--------------------------------------------------------------------------------
1 | /*Put Your CSS here and create your CSS files as needed in this directory*/
--------------------------------------------------------------------------------
/workspace-service/templates/flask/static/js/main.js:
--------------------------------------------------------------------------------
1 | // Put Your JS code here and create JS files as needed in this directory
--------------------------------------------------------------------------------
/workspace-service/templates/flask/templates/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/flask/templates/index.html
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
38 | # Environments
39 | .env
40 | .venv
41 | env/
42 | venv/
43 | ENV/
44 | env.bak/
45 | venv.bak/
46 |
47 | .stories/
48 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TransformerOptimus/SuperCoder/029d3709e061e53ec61ce3e7cb6b6709fe2f0c09/workspace-service/templates/nextjs/app/favicon.ico
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | @media (prefers-color-scheme: dark) {
12 | :root {
13 | --foreground-rgb: 255, 255, 255;
14 | --background-start-rgb: 0, 0, 0;
15 | --background-end-rgb: 0, 0, 0;
16 | }
17 | }
18 |
19 | body {
20 | color: rgb(var(--foreground-rgb));
21 | background: linear-gradient(
22 | to bottom,
23 | transparent,
24 | rgb(var(--background-end-rgb))
25 | )
26 | rgb(var(--background-start-rgb));
27 | }
28 |
29 | @layer utilities {
30 | .text-balance {
31 | text-wrap: balance;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import type { Metadata } from "next";
2 | import { Inter } from "next/font/google";
3 | import "./globals.css";
4 |
5 | const inter = Inter({ subsets: ["latin"] });
6 |
7 | export const metadata: Metadata = {
8 | title: "Create Next App",
9 | description: "Generated by create next app",
10 | };
11 |
12 | export default function RootLayout({
13 | children,
14 | }: Readonly<{
15 | children: React.ReactNode;
16 | }>) {
17 | return (
18 |
19 | {children}
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | output: 'export',
4 | basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
5 | };
6 |
7 | export default nextConfig;
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nextjs",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start -p 3001",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "react": "^18",
13 | "react-dom": "^18",
14 | "next": "14.2.4"
15 | },
16 | "devDependencies": {
17 | "typescript": "^5",
18 | "@types/node": "^20",
19 | "@types/react": "^18",
20 | "@types/react-dom": "^18",
21 | "postcss": "^8",
22 | "tailwindcss": "^3.4.1",
23 | "eslint": "^8",
24 | "eslint-config-next": "14.2.4"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('postcss-load-config').Config} */
2 | const config = {
3 | plugins: {
4 | tailwindcss: {},
5 | },
6 | };
7 |
8 | export default config;
9 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | const config: Config = {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | backgroundImage: {
12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
13 | "gradient-conic":
14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
15 | },
16 | },
17 | },
18 | plugins: [],
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/workspace-service/templates/nextjs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": true,
7 | "noEmit": true,
8 | "esModuleInterop": true,
9 | "module": "esnext",
10 | "moduleResolution": "bundler",
11 | "resolveJsonModule": true,
12 | "isolatedModules": true,
13 | "jsx": "preserve",
14 | "incremental": true,
15 | "plugins": [
16 | {
17 | "name": "next"
18 | }
19 | ],
20 | "paths": {
21 | "@/*": ["./*"]
22 | }
23 | },
24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25 | "exclude": ["node_modules"]
26 | }
27 |
--------------------------------------------------------------------------------