Compare commits

..

10 Commits

Author SHA1 Message Date
suricatingss
3ea91d9058 ez deploy 2025-12-05 20:45:01 +00:00
suricatingss
60a6342814 table complete 2025-12-05 20:39:32 +00:00
suricatingss
a1c71a967a table complete 2025-12-05 20:39:04 +00:00
suricatingss
662be26cc8 table complete 2025-12-05 20:38:41 +00:00
suricatingss
9d64bd5756 removed bootstrap, new table 2025-12-05 19:55:45 +00:00
suricatingss
5133f7ac66 commit 2025-12-05 19:55:20 +00:00
suricatingss
5ea16c7383 remove volume 2025-12-05 00:32:12 +00:00
suricatingss
c4c189d2a9 corrections 2025-12-05 00:22:13 +00:00
suricatingss
731273b1b0 link correction 2025-12-05 00:19:31 +00:00
suricatingss
a644256ccb change in dockerfile 2025-12-05 00:19:19 +00:00
6 changed files with 147 additions and 90 deletions

View File

@@ -1,4 +0,0 @@
node_modules
.git
.nuxt
.idea

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# This dockerfile is to turn .output into a docker image
# You still need to install the project on your machine and build it.
# Only then you run this docker file
# This project by default uses pnpm.
# If you wish to use npm, delete "pnpm-lock.yaml" first.
# 1. pnpm (or npm) i # If you get GNU problems, use pnpm (or npm) i --force
# 2. pnpm (or npm) run build # Sit back while it compiles
# 3. sudo docker build . -t myapp:latest (replace 'myapp' to whatever tag you wanna give your image)
# You should have the image now !
# Now you just need to create the container
# Here is an example command for creating a container
# sudo docker run -d --name myappcontainer --network host -e PORT=3000 myapp:latest
FROM node:22-alpine
WORKDIR /app
# Copy the build's result
COPY .output/ .
# Change the port and host
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "/app/server/index.mjs"]

View File

@@ -7,69 +7,37 @@ Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduct
Make sure to install dependencies: Make sure to install dependencies:
```bash ```bash
# npm npm i -g pnpm # (updates your pnpm :D)
npm install
# pnpm
pnpm install pnpm install
# yarn
yarn install
# bun
bun install
``` ```
(this project uses PNPM)
## Development Server ## Development Server
Start the development server on `http://localhost:3000`: Start the development server on `http://localhost:3000`:
```bash ```bash
# npm
npm run dev
# pnpm
pnpm dev pnpm dev
# yarn
yarn dev
# bun
bun run dev
``` ```
## Production ## Deployment
Build the application for production:
```bash ```bash
# npm
npm run build
# pnpm
pnpm build pnpm build
# yarn
yarn build
# bun
bun run build
``` ```
Locally preview production build: Locally preview production build:
```bash ```bash
# npm
npm run preview
# pnpm
pnpm preview pnpm preview
# yarn
yarn preview
# bun
bun run preview
``` ```
Start the production server
```bash
node .output/server/index.mjs
```
### Check out the docker file to turn your app into a container for easy deployment!
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

View File

@@ -15,7 +15,7 @@ const nav : NavigationMenuItem[][] = [[
}, { }, {
label: 'Contacts', label: 'Contacts',
icon: 'i-lucide-users', icon: 'i-lucide-users',
to: "/inbox" to: "/contacts"
}]]; }]];
/*[ /*[
{ {

View File

@@ -1,4 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { TableColumn } from "@nuxt/ui"
import { h } from 'vue'
definePageMeta({ definePageMeta({
layout: "dashboard" layout: "dashboard"
}); });
@@ -9,12 +12,12 @@
{ {
title: "1", title: "1",
icon: "meteor-icons:chevron-up", icon: "meteor-icons:chevron-up",
desc: "pila" desc: "epah ya bro"
}, },
{ {
title: "2", title: "2",
icon: "majesticons:award", icon: "majesticons:award",
desc: "bolas" desc: "bolinhas de natal ou whatever"
}, },
{ {
title: "3", title: "3",
@@ -23,6 +26,98 @@
}, },
]; ];
// create the object itself
type Payment = {
id: string,
date: string,
status: string,
email: string,
amount: number
}
const table_demo = ref<Payment[]>([
{
id: '4600',
date: '2024-03-11T15:30:00',
status: 'paid',
email: 'james.anderson@example.com',
amount: 594
},
{
id: '4599',
date: '2024-03-11T10:10:00',
status: 'failed',
email: 'mia.white@example.com',
amount: 276
},
{
id: '4598',
date: '2024-03-11T08:50:00',
status: 'refunded',
email: 'william.brown@example.com',
amount: 315
},
{
id: '4597',
date: '2024-03-10T19:45:00',
status: 'paid',
email: 'emma.davis@example.com',
amount: 529
},
{
id: '4596',
date: '2024-03-10T15:55:00',
status: 'paid',
email: 'ethan.harris@example.com',
amount: 639
}
])
const table_headers: TableColumn<Payment>[] = [
{
accessorKey: 'id',
header: "ID",
cell: ({ row }) => `#${row.getValue('id')}`
},
{
accessorKey: 'date',
header: "Date",
cell: ({ row }) => {
return new Date(row.getValue('date')).toLocaleString("pt-PT",{
day: "numeric",
month: "short",
hour: "2-digit",
minute: "2-digit",
hour12: false
})
}
},
{
accessorKey: 'status',
header: "Status",
cell: ({row}) => {
let color: string;
switch(row.getValue('status')){
case "paid":
color = "success"; break;
case "failed":
color = "error"; break;
case "refunded":
color = "warning"; break;
default:
color = "neutral";
}
return h(UBadge, { class: "capitalize", variant: "subtle", color },
() => row.getValue("status"))
}
},
{
accessorKey: 'amount',
header: "Ammount",
cell: ({ row }) => { return "€" + row.getValue('amount') }
}
]
</script> </script>
<template> <template>
@@ -30,24 +125,26 @@
<UDashboardSidebarToggle variant="subtle" class="absolute z-20 top-3 left-2.5"/> <UDashboardSidebarToggle variant="subtle" class="absolute z-20 top-3 left-2.5"/>
<div class="mt-1 mb-2 flex flex-col w-full relative z-0"> <div class="mt-1 mb-3 flex flex-col w-full relative z-0">
<ProseH2 class="text-center m-0.5 w-full">Hey there, user!</ProseH2> <ProseH2 class="text-center m-0.5 w-full">Hey there, user!</ProseH2>
<ProseP class="text-center text-muted m-0.5">Welcome to the UI!</ProseP> <ProseP class="text-center text-muted m-0.5">Welcome to the UI!</ProseP>
<UBadge variant="subtle" class="inline mx-auto">It's cool, isn't it ?</UBadge> <UBadge variant="subtle" class="inline mx-auto">It's cool, isn't it ?</UBadge>
</div> </div>
<div class="mx-auto max-w-220"> <!--<div class="mx-auto max-w-220">-->
<div class="row"> <UPageGrid class="lg:grid-cols-3 lg:gap-0 not-lg:gap-3">
<UPageCard <UPageCard
v-for="card in cards" v-for="card in cards"
:title="card.title" :title="card.title"
:description="card.desc" :description="card.desc"
:icon="card.icon" :icon="card.icon"
variant="subtle" variant="subtle"
class="dark-widget-bg col-md" class="dark-widget-bg col-lg lg:rounded-none first:lg:rounded-l-2xl last:lg:rounded-r-2xl sm:rounded-2xl"
/> />
</div> </UPageGrid>
</div>
<UTable :data="table_demo" :columns="table_headers"/>
</UContainer> </UContainer>
</template> </template>

View File

@@ -1,34 +0,0 @@
FROM node:22-alpine AS build
WORKDIR /app
#RUN corepack enable
# Copy package.json
COPY package.json .
# Install dependencies
RUN npm i --prod
# Copy the entire project
COPY . ./
# Build the project
RUN npm run build
# Build Stage 2
FROM node:22-alpine
WORKDIR /app
# Only `.output` folder is needed from the build stage
COPY --from=build /app/.output/ ./
# Change the port and host
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
VOLUME [ "/app" ]
CMD ["node", "/app/server/index.mjs"]