diff --git a/.gitea/workflows/deploy-frontend.yml b/.gitea/workflows/deploy-frontend.yml new file mode 100644 index 0000000..84ebf50 --- /dev/null +++ b/.gitea/workflows/deploy-frontend.yml @@ -0,0 +1,26 @@ +name: Deploy Frontend + +on: + push: + branches: ["master"] + paths: [".gitea/workflows/deploy-frontend.yml", "Frontend/**"] + +jobs: + docker: + runs-on: ubuntu-latest + defaults: + run: + working-directory: "./Frontend" + + # Steps to run + steps: + # Checkout the repo + - name: Checkout + uses: actions/checkout@v4 + + # Deploy to Dokku + - name: Deploy to Dokku + uses: dokku/github-action@master + with: + git_remote_url: "ssh://dokku@10.0.50.136:22/bs-tracker-frontend" + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14591a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +docker +.idea \ No newline at end of file diff --git a/Frontend/.eslintrc.json b/Frontend/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/Frontend/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/Frontend/.gitignore b/Frontend/.gitignore new file mode 100644 index 0000000..fd3dbb5 --- /dev/null +++ b/Frontend/.gitignore @@ -0,0 +1,36 @@ +# 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 diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile new file mode 100644 index 0000000..f15735b --- /dev/null +++ b/Frontend/Dockerfile @@ -0,0 +1,42 @@ +FROM imbios/bun-node AS base + +# Install dependencies +FROM base AS depends +WORKDIR /usr/src/app +COPY package.json* bun.lockb* ./ +RUN bun install --frozen-lockfile --quiet + +# Build the app +FROM base AS builder +WORKDIR /usr/src/app +COPY --from=depends /usr/src/app/node_modules ./node_modules +COPY . . +ENV NEXT_TELEMETRY_DISABLED 1 +RUN bun run build + + +# Run the app +FROM base AS runner +WORKDIR /usr/src/app + +RUN addgroup --system --gid 1007 nextjs +RUN adduser --system --uid 1007 nextjs + +RUN mkdir .next +RUN chown nextjs:nextjs .next + +COPY --from=builder --chown=nextjs:nextjs /usr/src/app/node_modules ./node_modules +COPY --from=builder --chown=nextjs:nextjs /usr/src/app/.next ./.next +COPY --from=builder --chown=nextjs:nextjs /usr/src/app/next.config.mjs ./next.config.mjs +COPY --from=builder --chown=nextjs:nextjs /usr/src/app/package.json ./package.json + +ENV NODE_ENV production + +# Exposting on port 80 so we can +# access via a reverse proxy for Dokku +ENV HOSTNAME "0.0.0.0" +EXPOSE 80 +ENV PORT 80 + +USER nextjs +CMD ["bun", "start"] \ No newline at end of file diff --git a/Frontend/README.md b/Frontend/README.md new file mode 100644 index 0000000..c403366 --- /dev/null +++ b/Frontend/README.md @@ -0,0 +1,36 @@ +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). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +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. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/Frontend/bun.lockb b/Frontend/bun.lockb new file mode 100644 index 0000000..b50ac12 Binary files /dev/null and b/Frontend/bun.lockb differ diff --git a/Frontend/next.config.mjs b/Frontend/next.config.mjs new file mode 100644 index 0000000..4678774 --- /dev/null +++ b/Frontend/next.config.mjs @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {}; + +export default nextConfig; diff --git a/Frontend/package.json b/Frontend/package.json new file mode 100644 index 0000000..02006d7 --- /dev/null +++ b/Frontend/package.json @@ -0,0 +1,26 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "react": "^18", + "react-dom": "^18", + "next": "14.2.5" + }, + "devDependencies": { + "typescript": "^5", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "postcss": "^8", + "tailwindcss": "^3.4.1", + "eslint": "^8", + "eslint-config-next": "14.2.5" + } +} diff --git a/Frontend/postcss.config.mjs b/Frontend/postcss.config.mjs new file mode 100644 index 0000000..1a69fd2 --- /dev/null +++ b/Frontend/postcss.config.mjs @@ -0,0 +1,8 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: { + tailwindcss: {}, + }, +}; + +export default config; diff --git a/Frontend/public/next.svg b/Frontend/public/next.svg new file mode 100644 index 0000000..5174b28 --- /dev/null +++ b/Frontend/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Frontend/public/vercel.svg b/Frontend/public/vercel.svg new file mode 100644 index 0000000..d2f8422 --- /dev/null +++ b/Frontend/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Frontend/src/app/favicon.ico b/Frontend/src/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/Frontend/src/app/favicon.ico differ diff --git a/Frontend/src/app/globals.css b/Frontend/src/app/globals.css new file mode 100644 index 0000000..875c01e --- /dev/null +++ b/Frontend/src/app/globals.css @@ -0,0 +1,33 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/Frontend/src/app/layout.tsx b/Frontend/src/app/layout.tsx new file mode 100644 index 0000000..3314e47 --- /dev/null +++ b/Frontend/src/app/layout.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; +import "./globals.css"; + +const inter = Inter({ subsets: ["latin"] }); + +export const metadata: Metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + {children} + + ); +} diff --git a/Frontend/src/app/page.tsx b/Frontend/src/app/page.tsx new file mode 100644 index 0000000..2acfd44 --- /dev/null +++ b/Frontend/src/app/page.tsx @@ -0,0 +1,113 @@ +import Image from "next/image"; + +export default function Home() { + return ( +
+
+

+ Get started by editing  + src/app/page.tsx +

+
+ + By{" "} + Vercel Logo + +
+
+ +
+ Next.js Logo +
+ +
+ +

+ Docs{" "} + + -> + +

+

+ Find in-depth information about Next.js features and API. +

+
+ + +

+ Learn{" "} + + -> + +

+

+ Learn about Next.js in an interactive course with quizzes! +

+
+ + +

+ Templates{" "} + + -> + +

+

+ Explore starter templates for Next.js. +

+
+ + +

+ Deploy{" "} + + -> + +

+

+ Instantly deploy your Next.js site to a shareable URL with Vercel. +

+
+
+
+ ); +} diff --git a/Frontend/tailwind.config.ts b/Frontend/tailwind.config.ts new file mode 100644 index 0000000..e9a0944 --- /dev/null +++ b/Frontend/tailwind.config.ts @@ -0,0 +1,20 @@ +import type { Config } from "tailwindcss"; + +const config: Config = { + content: [ + "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", + "./src/components/**/*.{js,ts,jsx,tsx,mdx}", + "./src/app/**/*.{js,ts,jsx,tsx,mdx}", + ], + theme: { + extend: { + backgroundImage: { + "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", + "gradient-conic": + "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", + }, + }, + }, + plugins: [], +}; +export default config; diff --git a/Frontend/tsconfig.json b/Frontend/tsconfig.json new file mode 100644 index 0000000..7b28589 --- /dev/null +++ b/Frontend/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +}