subrajeet commited on
Commit
776ef01
1 Parent(s): 8374699

Upload 15 files

Browse files
Files changed (15) hide show
  1. .dockerignore +24 -0
  2. .env +2 -0
  3. .eslintrc.json +3 -0
  4. .gitignore +36 -0
  5. Dockerfile +65 -0
  6. README.md +36 -11
  7. components.json +16 -0
  8. next-env.d.ts +5 -0
  9. next.config.js +23 -0
  10. package-lock.json +0 -0
  11. package.json +37 -0
  12. postcss.config.js +6 -0
  13. tailwind.config.js +76 -0
  14. tailwind.config.ts +20 -0
  15. tsconfig.json +27 -0
.dockerignore ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ **/.classpath
2
+ **/.dockerignore
3
+ **/.env
4
+ **/.git
5
+ **/.gitignore
6
+ **/.project
7
+ **/.settings
8
+ **/.toolstarget
9
+ **/.vs
10
+ **/.vscode
11
+ **/*.*proj.user
12
+ **/*.dbmdl
13
+ **/*.jfm
14
+ **/charts
15
+ **/docker-compose*
16
+ **/compose*
17
+ **/Dockerfile*
18
+ **/node_modules
19
+ **/npm-debug.log
20
+ **/obj
21
+ **/secrets.dev.yaml
22
+ **/values.dev.yaml
23
+ LICENSE
24
+ README.md
.env ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ UPLOADTHING_SECRET=sk_live_5a90f295fe50e167faee22fe02e212ffba43a525533c5a5202605fd8c046c5ac
2
+ UPLOADTHING_APP_ID=7kao66kypm
.eslintrc.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "extends": "next/core-web-vitals"
3
+ }
.gitignore ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
Dockerfile ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18 AS base
2
+
3
+ # Install dependencies only when needed
4
+ FROM base AS deps
5
+ WORKDIR /app
6
+
7
+ # Install dependencies based on the preferred package manager
8
+ COPY --link package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
9
+ RUN npm config set registry http://registry.npmjs.org/
10
+ RUN \
11
+ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
12
+ elif [ -f package-lock.json ]; then npm ci; \
13
+ elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
14
+ else echo "Lockfile not found." && exit 1; \
15
+ fi
16
+
17
+
18
+ # Rebuild the source code only when needed
19
+ FROM base AS builder
20
+ WORKDIR /app
21
+ COPY --from=deps --link /app/node_modules ./node_modules
22
+ COPY --link . .
23
+
24
+ # Next.js collects completely anonymous telemetry data about general usage.
25
+ # Learn more here: https://nextjs.org/telemetry
26
+ # Uncomment the following line in case you want to disable telemetry during the build.
27
+ # ENV NEXT_TELEMETRY_DISABLED 1
28
+
29
+ ENV UPLOADTHING_SECRET=sk_live_5a90f295fe50e167faee22fe02e212ffba43a525533c5a5202605fd8c046c5ac
30
+ ENV UPLOADTHING_APP_ID=7kao66kypm
31
+
32
+ RUN npm run build
33
+
34
+ # Production image, copy all the files and run next
35
+ FROM base AS runner
36
+ WORKDIR /app
37
+ # Uncomment the following line in case you want to disable telemetry during runtime.
38
+ # ENV NEXT_TELEMETRY_DISABLED 1
39
+
40
+ RUN \
41
+ addgroup --system --gid 1001 nodejs; \
42
+ adduser --system --uid 1001 nextjs
43
+
44
+ COPY --from=builder --link /app/public ./public
45
+
46
+ # Automatically leverage output traces to reduce image size
47
+ # https://nextjs.org/docs/advanced-features/output-file-tracing
48
+ COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./
49
+ COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static
50
+
51
+ USER nextjs
52
+
53
+ EXPOSE 3000
54
+ ENV PORT 3000
55
+ # ENV HOSTNAME localhost
56
+ ENV NODE_ENV=production
57
+ ENV UPLOADTHING_SECRET=sk_live_5a90f295fe50e167faee22fe02e212ffba43a525533c5a5202605fd8c046c5ac
58
+ ENV UPLOADTHING_APP_ID=7kao66kypm
59
+
60
+ # Allow the running process to write model files to the cache folder.
61
+ # NOTE: In practice, you would probably want to pre-download the model files to avoid having to download them on-the-fly.
62
+ RUN mkdir -p /app/node_modules/@xenova/.cache/
63
+ RUN chmod 777 -R /app/node_modules/@xenova/
64
+
65
+ CMD ["node", "server.js"]
README.md CHANGED
@@ -1,11 +1,36 @@
1
- ---
2
- title: Object Detection
3
- emoji: 🌍
4
- colorFrom: indigo
5
- colorTo: yellow
6
- sdk: docker
7
- pinned: false
8
- license: mit
9
- ---
10
-
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
components.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.js",
8
+ "css": "app/globals.css",
9
+ "baseColor": "slate",
10
+ "cssVariables": true
11
+ },
12
+ "aliases": {
13
+ "components": "@/components",
14
+ "utils": "@/lib/utils"
15
+ }
16
+ }
next-env.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+
4
+ // NOTE: This file should not be edited
5
+ // see https://nextjs.org/docs/basic-features/typescript for more information.
next.config.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const { hostname } = require('os');
2
+
3
+ /** @type {import('next').NextConfig} */
4
+ const nextConfig = {
5
+ images: {
6
+ remotePatterns: [
7
+ {
8
+ protocol: 'https',
9
+ hostname: 'utfs.io',
10
+ }
11
+ ]
12
+ },
13
+ // (Optional) Export as a standalone site
14
+ // See https://nextjs.org/docs/pages/api-reference/next-config-js/output#automatically-copying-traced-files
15
+ output: 'standalone', // Feel free to modify/remove this option
16
+
17
+ // Indicate that these packages should not be bundled by webpack
18
+ experimental: {
19
+ serverComponentsExternalPackages: ['sharp', 'onnxruntime-node'],
20
+ },
21
+ };
22
+
23
+ module.exports = nextConfig
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "object-detection",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint"
10
+ },
11
+ "dependencies": {
12
+ "@radix-ui/react-slot": "^1.0.2",
13
+ "@uploadthing/react": "^6.0.2",
14
+ "@xenova/transformers": "^2.12.1",
15
+ "axios": "^1.6.2",
16
+ "class-variance-authority": "^0.7.0",
17
+ "clsx": "^2.0.0",
18
+ "lucide-react": "^0.299.0",
19
+ "next": "14.0.4",
20
+ "react": "^18",
21
+ "react-dom": "^18",
22
+ "tailwind-merge": "^2.2.0",
23
+ "tailwindcss-animate": "^1.0.7",
24
+ "uploadthing": "^6.1.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "^20",
28
+ "@types/react": "^18",
29
+ "@types/react-dom": "^18",
30
+ "autoprefixer": "^10.0.1",
31
+ "eslint": "^8",
32
+ "eslint-config-next": "14.0.4",
33
+ "postcss": "^8",
34
+ "tailwindcss": "^3.3.0",
35
+ "typescript": "^5"
36
+ }
37
+ }
postcss.config.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
tailwind.config.js ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ darkMode: ["class"],
4
+ content: [
5
+ './pages/**/*.{ts,tsx}',
6
+ './components/**/*.{ts,tsx}',
7
+ './app/**/*.{ts,tsx}',
8
+ './src/**/*.{ts,tsx}',
9
+ ],
10
+ theme: {
11
+ container: {
12
+ center: true,
13
+ padding: "2rem",
14
+ screens: {
15
+ "2xl": "1400px",
16
+ },
17
+ },
18
+ extend: {
19
+ colors: {
20
+ border: "hsl(var(--border))",
21
+ input: "hsl(var(--input))",
22
+ ring: "hsl(var(--ring))",
23
+ background: "hsl(var(--background))",
24
+ foreground: "hsl(var(--foreground))",
25
+ primary: {
26
+ DEFAULT: "hsl(var(--primary))",
27
+ foreground: "hsl(var(--primary-foreground))",
28
+ },
29
+ secondary: {
30
+ DEFAULT: "hsl(var(--secondary))",
31
+ foreground: "hsl(var(--secondary-foreground))",
32
+ },
33
+ destructive: {
34
+ DEFAULT: "hsl(var(--destructive))",
35
+ foreground: "hsl(var(--destructive-foreground))",
36
+ },
37
+ muted: {
38
+ DEFAULT: "hsl(var(--muted))",
39
+ foreground: "hsl(var(--muted-foreground))",
40
+ },
41
+ accent: {
42
+ DEFAULT: "hsl(var(--accent))",
43
+ foreground: "hsl(var(--accent-foreground))",
44
+ },
45
+ popover: {
46
+ DEFAULT: "hsl(var(--popover))",
47
+ foreground: "hsl(var(--popover-foreground))",
48
+ },
49
+ card: {
50
+ DEFAULT: "hsl(var(--card))",
51
+ foreground: "hsl(var(--card-foreground))",
52
+ },
53
+ },
54
+ borderRadius: {
55
+ lg: "var(--radius)",
56
+ md: "calc(var(--radius) - 2px)",
57
+ sm: "calc(var(--radius) - 4px)",
58
+ },
59
+ keyframes: {
60
+ "accordion-down": {
61
+ from: { height: 0 },
62
+ to: { height: "var(--radix-accordion-content-height)" },
63
+ },
64
+ "accordion-up": {
65
+ from: { height: "var(--radix-accordion-content-height)" },
66
+ to: { height: 0 },
67
+ },
68
+ },
69
+ animation: {
70
+ "accordion-down": "accordion-down 0.2s ease-out",
71
+ "accordion-up": "accordion-up 0.2s ease-out",
72
+ },
73
+ },
74
+ },
75
+ plugins: [require("tailwindcss-animate")],
76
+ }
tailwind.config.ts ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import type { Config } from 'tailwindcss'
2
+
3
+ const config: Config = {
4
+ content: [
5
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
6
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
7
+ './src/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
tsconfig.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "preserve",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./src/*"]
23
+ }
24
+ },
25
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26
+ "exclude": ["node_modules"]
27
+ }