diff --git a/.env.example b/.env.example deleted file mode 100644 index d7419a983b3e8d6606db990addea8d78dd660692..0000000000000000000000000000000000000000 --- a/.env.example +++ /dev/null @@ -1,4 +0,0 @@ -AUTH_HUGGINGFACE_ID= -AUTH_HUGGINGFACE_SECRET= -NEXTAUTH_URL=http://localhost:3001 -AUTH_SECRET= \ No newline at end of file diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml deleted file mode 100644 index 88d7e85dd2f708097a42154a349c9cb217479120..0000000000000000000000000000000000000000 --- a/.github/workflows/deploy-prod.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Deploy to k8s -on: - # run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build-and-publish: - runs-on: - group: cpu-high - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: registry.internal.huggingface.tech - username: ${{ secrets.DOCKER_INTERNAL_USERNAME }} - password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }} - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: | - registry.internal.huggingface.tech/deepsite/deepsite - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=sha,enable=true,prefix=sha-,format=short,sha-len=8 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - - - name: Build and Publish image - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64 - cache-to: type=gha,mode=max,scope=amd64 - cache-from: type=gha,scope=amd64 - provenance: false - - deploy: - name: Deploy on prod - runs-on: ubuntu-latest - needs: ["build-and-publish"] - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - - - name: Gen values - run: | - VALUES=$(cat <<-END - image: - tag: "sha-${{ env.GITHUB_SHA_SHORT }}" - END - ) - echo "VALUES=$(echo "$VALUES" | yq -o=json | jq tostring)" >> $GITHUB_ENV - - - name: Deploy on infra-deployments - uses: the-actions-org/workflow-dispatch@v2 - with: - workflow: Update application single value - repo: huggingface/infra-deployments - wait-for-completion: true - wait-for-completion-interval: 10s - display-workflow-run-url-interval: 10s - ref: refs/heads/main - token: ${{ secrets.GIT_TOKEN_INFRA_DEPLOYMENT }} - inputs: '{"path": "hub/deepsite/deepsite.yaml", "value": ${{ env.VALUES }}, "url": "${{ github.event.head_commit.url }}"}' diff --git a/.gitignore b/.gitignore index b8b89cbb382fac7dea7fdeb461bd43beb9937c49..5ef6a520780202a1d6addd833d800ccb1ecac0bb 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,7 @@ yarn-error.log* .pnpm-debug.log* # env files (can opt-in for committing if needed) -.env +.env* # vercel .vercel @@ -39,9 +39,3 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts - -.idea - -# binary assets (hosted on CDN) -assets/assistant.jpg -.gitattributes \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a2b0759c0a612c3be02d8c1eb3021252cdd4a7f8..cbe0188aaee92186937765d2c85d76f7b212c537 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,19 @@ FROM node:20-alpine USER root -# Install pnpm -RUN corepack enable && corepack prepare pnpm@latest --activate - USER 1000 WORKDIR /usr/src/app -# Copy package.json and pnpm-lock.yaml to the container -COPY --chown=1000 package.json pnpm-lock.yaml ./ +# Copy package.json and package-lock.json to the container +COPY --chown=1000 package.json package-lock.json ./ # Copy the rest of the application files to the container COPY --chown=1000 . . -RUN pnpm install -RUN pnpm run build +RUN npm install +RUN npm run build # Expose the application port (assuming your app runs on port 3000) -EXPOSE 3001 +EXPOSE 3000 # Start the application -CMD ["pnpm", "start"] \ No newline at end of file +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index 6b13fd8b95aeb699f979cbc2cbb8d7495aeacdf5..5ab2231fc7dc96070548f1d03ab1d0f73a799600 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ --- -title: DeepSite v4 +title: DeepSite v2 emoji: 🐳 colorFrom: blue colorTo: blue sdk: docker pinned: true -app_port: 3001 +app_port: 3000 license: mit -failure_strategy: rollback -short_description: Generate any application by Vibe Coding it +short_description: Generate any application with DeepSeek models: - deepseek-ai/DeepSeek-V3-0324 - - deepseek-ai/DeepSeek-V3.2 - - Qwen/Qwen3-Coder-30B-A3B-Instruct - - moonshotai/Kimi-K2-Instruct-0905 - - zai-org/GLM-4.7 - - MiniMaxAI/MiniMax-M2.1 + - deepseek-ai/DeepSeek-R1-0528 --- # DeepSite 🐳 -DeepSite is a Vibe Coding Platform designed to make coding smarter and more efficient. Tailored for developers, data scientists, and AI engineers, it integrates generative AI into your coding projects to enhance creativity and productivity. +DeepSite is a coding platform powered by DeepSeek AI, designed to make coding smarter and more efficient. Tailored for developers, data scientists, and AI engineers, it integrates generative AI into your coding projects to enhance creativity and productivity. + +## How to use it locally + +Follow [this discussion](https://huggingface.co/spaces/enzostvs/deepsite/discussions/74) diff --git a/actions/mentions.ts b/actions/mentions.ts deleted file mode 100644 index c6b7dabfbaa6f0efe0d492dfe5470353b0139bae..0000000000000000000000000000000000000000 --- a/actions/mentions.ts +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -import { File } from "@/lib/type"; - -export const searchMentions = async (query: string) => { - const promises = [searchModels(query), searchDatasets(query)]; - const results = await Promise.all(promises); - return { models: results[0], datasets: results[1] }; -}; - -const searchModels = async (query: string) => { - const response = await fetch( - `https://huggingface.co/api/quicksearch?q=${query}&type=model&limit=3` - ); - const data = await response.json(); - return data?.models ?? []; -}; - -const searchDatasets = async (query: string) => { - const response = await fetch( - `https://huggingface.co/api/quicksearch?q=${query}&type=dataset&limit=3` - ); - const data = await response.json(); - return data?.datasets ?? []; -}; - -export const searchFilesMentions = async (query: string, files: File[]) => { - if (!query) return files; - const lowerQuery = query.toLowerCase(); - return files.filter((file) => file.path.toLowerCase().includes(lowerQuery)); -}; diff --git a/actions/projects.ts b/actions/projects.ts deleted file mode 100644 index d6f685b63290792fc597438a53eab0a14d6bbf8e..0000000000000000000000000000000000000000 --- a/actions/projects.ts +++ /dev/null @@ -1,175 +0,0 @@ -"use server"; -import { - downloadFile, - listCommits, - listFiles, - listSpaces, - RepoDesignation, - SpaceEntry, - spaceInfo, -} from "@huggingface/hub"; - -import { auth } from "@/lib/auth"; -import { Commit, File } from "@/lib/type"; - -export interface ProjectWithCommits extends SpaceEntry { - commits?: Commit[]; - medias?: string[]; -} - -const IGNORED_PATHS = ["README.md", ".gitignore", ".gitattributes"]; -const IGNORED_FORMATS = [ - ".png", - ".jpg", - ".jpeg", - ".gif", - ".svg", - ".webp", - ".mp4", - ".mp3", - ".wav", -]; - -export const getProjects = async () => { - const projects: SpaceEntry[] = []; - const session = await auth(); - if (!session?.user) { - return projects; - } - const token = session.accessToken; - for await (const space of listSpaces({ - accessToken: token, - additionalFields: ["author", "cardData"], - search: { - owner: session.user.username, - }, - })) { - if ( - space.sdk === "static" && - Array.isArray((space.cardData as { tags?: string[] })?.tags) && - (space.cardData as { tags?: string[] })?.tags?.some((tag) => - tag.includes("deepsite") - ) - ) { - projects.push(space); - } - } - return projects; -}; -export const getProject = async (id: string, commitId?: string) => { - const session = await auth(); - if (!session?.user) { - return null; - } - const token = session.accessToken; - try { - const project: ProjectWithCommits | null = await spaceInfo({ - name: id, - accessToken: token, - additionalFields: ["author", "cardData"], - }); - const repo: RepoDesignation = { - type: "space", - name: id, - }; - const files: File[] = []; - const medias: string[] = []; - const params = { repo, accessToken: token }; - if (commitId) { - Object.assign(params, { revision: commitId }); - } - for await (const fileInfo of listFiles(params)) { - if (IGNORED_PATHS.includes(fileInfo.path)) continue; - if (IGNORED_FORMATS.some((format) => fileInfo.path.endsWith(format))) { - medias.push( - `https://huggingface.co/spaces/${id}/resolve/main/${fileInfo.path}` - ); - continue; - } - - if (fileInfo.type === "directory") { - for await (const subFile of listFiles({ - repo, - accessToken: token, - path: fileInfo.path, - })) { - if (IGNORED_FORMATS.some((format) => subFile.path.endsWith(format))) { - medias.push( - `https://huggingface.co/spaces/${id}/resolve/main/${subFile.path}` - ); - } - const blob = await downloadFile({ - repo, - accessToken: token, - path: subFile.path, - raw: true, - ...(commitId ? { revision: commitId } : {}), - }).catch((_) => { - return null; - }); - if (!blob) { - continue; - } - const html = await blob?.text(); - if (!html) { - continue; - } - files[subFile.path === "index.html" ? "unshift" : "push"]({ - path: subFile.path, - content: html, - }); - } - } else { - const blob = await downloadFile({ - repo, - accessToken: token, - path: fileInfo.path, - raw: true, - ...(commitId ? { revision: commitId } : {}), - }).catch((_) => { - return null; - }); - if (!blob) { - continue; - } - const html = await blob?.text(); - if (!html) { - continue; - } - files[fileInfo.path === "index.html" ? "unshift" : "push"]({ - path: fileInfo.path, - content: html, - }); - } - } - const commits: Commit[] = []; - const commitIterator = listCommits({ repo, accessToken: token }); - for await (const commit of commitIterator) { - if ( - commit.title?.toLowerCase() === "initial commit" || - commit.title - ?.toLowerCase() - ?.includes("upload media files through deepsite") - ) - continue; - commits.push({ - title: commit.title, - oid: commit.oid, - date: commit.date, - }); - if (commits.length >= 20) { - break; - } - } - - project.commits = commits; - project.medias = medias; - - return { project, files }; - } catch (error) { - return { - project: null, - files: [], - }; - } -}; diff --git a/app/(public)/layout.tsx b/app/(public)/layout.tsx index 0eb2c8fbb85b745d5be01c9e79fa0ebc93a71d00..4a4ec57d2609c783602beb6c06c8dca6a1e6192d 100644 --- a/app/(public)/layout.tsx +++ b/app/(public)/layout.tsx @@ -1,12 +1,13 @@ -import { Navigation } from "@/components/public/navigation"; +import Navigation from "@/components/public/navigation"; -export default function PublicLayout({ +export default async function PublicLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { return ( -
+ Vibe Coding has never been so easy. +
+- You can't access this resource without being signed in. -
-