Skip to content

Commit

Permalink
sanchayai phoenixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadesh Kulkarni authored and Aadesh Kulkarni committed May 16, 2024
1 parent 7042e05 commit 7195c0a
Show file tree
Hide file tree
Showing 59 changed files with 7,981 additions and 832 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions api/database.py

This file was deleted.

36 changes: 0 additions & 36 deletions api/main.py

This file was deleted.

18 changes: 0 additions & 18 deletions api/models.py

This file was deleted.

32 changes: 0 additions & 32 deletions api/readme.MD

This file was deleted.

17 changes: 0 additions & 17 deletions api/requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions api/run.py

This file was deleted.

18 changes: 0 additions & 18 deletions api/scripts/subtitles.py

This file was deleted.

Binary file added apps/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions apps/web-app/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": []
}
10 changes: 10 additions & 0 deletions apps/web-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git
.results
scripts
*Dockerfile*
node_modules
.dockerignore
.gitignore
.next
out
public
6 changes: 6 additions & 0 deletions apps/web-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AWS_ACCESS_KEY_ID = "na"
AWS_SECRET_ACCESS_KEY = "na"
AWS_REGION_NAME = "ap-south-1"
S3_BUCKET_NAME = "sanchayai"
MONGO_DB=""
RABBITMQ_DEV="amqp:https://guest:guest@localhost:5672"
3 changes: 3 additions & 0 deletions apps/web-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/babel","next/core-web-vitals"]
}
39 changes: 39 additions & 0 deletions apps/web-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.next

.env
9 changes: 9 additions & 0 deletions apps/web-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20-alpine

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]
11 changes: 11 additions & 0 deletions apps/web-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Setup

- copy .env.example and rename it as .env
- add MongoDB connection string
- `npm run dev`


### Tech
- NextJS
- Tailwind
- ShadCDN
7 changes: 7 additions & 0 deletions apps/web-app/app/api/videos/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { NextResponse } from "next/server";
import { Video } from "../../db/model";

export const GET = async () => {
const data = await Video.find();
return NextResponse.json({ data: data });
};
12 changes: 12 additions & 0 deletions apps/web-app/app/components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Link from 'next/link'

const Header = () => {
return (
<div className="w-screen bg-black text-white p-4 flex justify-start gap-8 items-center px-8">
<Link href="/"><h1 className="text-2xl">Sanchay.ai</h1></Link>
<Link href='/view' className="underline">Your videos</Link>
</div>
)
}

export default Header
56 changes: 56 additions & 0 deletions apps/web-app/app/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-gray-950 dark:focus-visible:ring-gray-300",
{
variants: {
variant: {
default: "bg-gray-900 text-gray-50 hover:bg-gray-900/90 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/90",
destructive:
"bg-red-500 text-gray-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/90",
outline:
"border border-gray-200 bg-white hover:bg-gray-100 hover:text-gray-900 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-800 dark:hover:text-gray-50",
secondary:
"bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80",
ghost: "hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-50",
link: "text-gray-900 underline-offset-4 hover:underline dark:text-gray-50",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
)
Button.displayName = "Button"

export { Button, buttonVariants }
19 changes: 19 additions & 0 deletions apps/web-app/app/db/model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import mongoose from "mongoose";

const MONGODB_URL = process.env.MONGO_DB;
console.log("Aadesh: ",MONGODB_URL)

mongoose.connect(MONGODB_URL);

const videoSchema = new mongoose.Schema({
videoUrl: String,
transcription: String,
subtitles: String,
chapters: String,
title: String,
description: String,
});

const Video = mongoose.models.Video || mongoose.model("Video", videoSchema);

export { Video };
Binary file added apps/web-app/app/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions apps/web-app/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
Loading

0 comments on commit 7195c0a

Please sign in to comment.