Skip to content

Commit

Permalink
docs: readme;md
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloCarnevale committed Sep 11, 2024
1 parent 39ccd3d commit 5136b45
Show file tree
Hide file tree
Showing 15 changed files with 303 additions and 73 deletions.
102 changes: 81 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,96 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# Service Order Tool

## Getting Started
Este repositório contém o código de uma plataforma web desenvolvida com Next.js para o front-end, que tem como objetivo facilitar a gestão de uma oficina, possibilitando a criação e o gerenciamento de ordens de serviço, veículos e projetos.

First, run the development server:
## Funcionalidades

- Ordens de Serviço: Criação, visualização, edição e exclusão de ordens de serviço, com controle do status de cada tarefa.

- Gestão de Veículos: Registro de veículos com informações detalhadas, como fabricante, modelo, ano, número do chassi, entre outros.
- Gerenciamento de Projetos: Acompanhe os projetos da oficina, associando veículos e ordens de serviço a cada projeto.
- Interface Amigável: Design moderno e responsivo utilizando Tailwind CSS.
- Autenticação: Sistema de autenticação para controlar o acesso de usuários.

## Tecnologias Utilizadas

- Next.js: Framework de React para renderização do front-end e geração de páginas dinâmicas.

- Tailwind CSS: Biblioteca de CSS utilitária para criação de interfaces responsivas e customizáveis.

- Docker: Para criar e gerenciar os containers de desenvolvimento.

- MSSQL: Banco de dados para armazenar os dados

## Pré-requisitos

- Node.js v18+
- NPM ou Yarn
- Docker (opcional, para ambientes de desenvolvimento)

## Instalação

1. Clone o repositório:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
git clone https://github.com/PS-smarthub/sot.git
cd seu-repositorio
```

2. Instale as dependências:

```bash Copiar Código
npm install
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
ou, se estimer usando pnpm

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
```bash Copiar Código
pnpm install
```

3. Configure as variáveis de ambiente:

Crie um arquivo .env.local na raiz do projeto e configure as variáveis de ambiente necessárias para o banco de dados, autenticação e outras integrações. Exemplo:

```bash
DATABASE_URL=mongodb://localhost:27017/oficina
NEXTAUTH_URL=http://localhost:3000
```

4. Inicie o ambiente de desenvolvimento:

```bash
npm run dev
```

ou com pnpm

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
```bash
pnpm dev
```

## Learn More
5. Acesse a aplicação em http://localhost:3000.

To learn more about Next.js, take a look at the following resources:
## Utilização

- [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.
Após iniciar o ambiente de desenvolvimento, você poderá acessar a plataforma e:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
- Criar novas ordens de serviço, atribuir status e acompanhar o progresso.
- dicionar veículos à oficina e editar seus detalhes.
- Gerenciar projetos, associando ordens de serviço e veículos a cada um deles.

## Deploy on Vercel
## Estrutura do Projeto

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.
Abaixo está um resumo da estrutura de pastas do projeto:

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
```
src/
├── components # Componentes reutilizáveis de UI
├── app # Páginas do Next.js (rotas da aplicação)
│ ├── api # API routes para o backend
│ ├── app # Página inicial da aplicação (Ordens de Serviço)
│ ├── vehicles # Página de gerenciamento de veículos
│ ├── projects # Página de gerenciamento de projetos
│ └── settings # Página de configuração
├── public # Arquivos públicos (imagens, ícones, etc.)
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.2",
"@tanstack/react-table": "^8.20.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async function Layout({ children }: PropsWithChildren) {
return (
<div className="grid grid-cols-[16rem_1fr] ">
<MainSidebar user={session?.user} />
<main>{children}</main>
<main className="flex-1 overflow-auto">{children}</main>
</div>
);
}
14 changes: 14 additions & 0 deletions src/app/app/projects/(main)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DashboardPage, DashboardPageHeader, DashboardPageHeaderTitle, DashboardPageMain } from '@/components/dashboard/page'

export default function Page() {
return (
<DashboardPage>
<DashboardPageHeader>
<DashboardPageHeaderTitle>Projetos</DashboardPageHeaderTitle>
</DashboardPageHeader>
<DashboardPageMain>
Projetos
</DashboardPageMain>
</DashboardPage>
)
}
8 changes: 4 additions & 4 deletions src/app/app/settings/theme/_components/ThemeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function ThemeForm() {
</div>
</div>
<span className="block w-full p-2 text-center font-normal">
Light
Claro
</span>
</FormLabel>
</FormItem>
Expand All @@ -92,7 +92,7 @@ export function ThemeForm() {
</div>
</div>
<span className="block w-full p-2 text-center font-normal">
Dark
Escuro
</span>
</FormLabel>
</FormItem>
Expand All @@ -103,8 +103,8 @@ export function ThemeForm() {
</CardContent>
</Card>
<Button disabled={form.formState.isSubmitting} type="submit">
{form.formState.isSubmitting && "Saving..."}
{!form.formState.isSubmitting && "Save changes"}
{form.formState.isSubmitting && "Salvando..."}
{!form.formState.isSubmitting && "Salvar"}
</Button>
</form>
</Form >)
Expand Down
40 changes: 9 additions & 31 deletions src/app/app/vehicles/(main)/_components/vehicle-data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import * as React from "react"
import {
CaretSortIcon,
ChevronDownIcon,
DotsHorizontalIcon,
PlusIcon,
} from "@radix-ui/react-icons"
import {
ColumnDef,
Expand All @@ -22,7 +22,6 @@ import {
import { Button } from "@/components/ui/button"
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
Expand All @@ -38,6 +37,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table"
import Link from "next/link"

type Vehicle = {
id: number;
Expand Down Expand Up @@ -174,7 +174,7 @@ export function VehicleDataTable({ data }: VehicleDataTable) {

return (
<div className="w-full">
<div className="flex items-center py-4">
<div className="flex items-center justify-between py-4">
<Input
placeholder="Filtrar montadora..."
value={(table.getColumn("automaker")?.getFilterValue() as string) ?? ""}
Expand All @@ -183,32 +183,10 @@ export function VehicleDataTable({ data }: VehicleDataTable) {
}
className="max-w-sm"
/>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="ml-auto">
Columns <ChevronDownIcon className="ml-2 h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
{table
.getAllColumns()
.filter((column) => column.getCanHide())
.map((column) => {
return (
<DropdownMenuCheckboxItem
key={column.id}
className="capitalize"
checked={column.getIsVisible()}
onCheckedChange={(value) =>
column.toggleVisibility(!!value)
}
>
{column.id}
</DropdownMenuCheckboxItem>
)
})}
</DropdownMenuContent>
</DropdownMenu>
<Link href={"/app/vehicles/new"} className='inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 p-2 gap-2 bg-primary text-primary-foreground shadow hover:bg-primary/90'>
<PlusIcon />
Cadastrar
</Link>
</div>
<div className="rounded-md border">
<Table>
Expand Down Expand Up @@ -272,15 +250,15 @@ export function VehicleDataTable({ data }: VehicleDataTable) {
onClick={() => table.previousPage()}
disabled={!table.getCanPreviousPage()}
>
Previous
Voltar
</Button>
<Button
variant="outline"
size="sm"
onClick={() => table.nextPage()}
disabled={!table.getCanNextPage()}
>
Next
Próximo
</Button>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/app/vehicles/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export default async function Page() {
const vehicles = await getVehicles()
return (
<VehicleDataTable data={vehicles} />

)
}
11 changes: 2 additions & 9 deletions src/app/app/vehicles/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { DashboardPage, DashboardPageHeader, DashboardPageHeaderNav, DashboardPageHeaderTitle, DashboardPageMain } from '@/components/dashboard/page'
import { Button } from '@/components/ui/button'
import { DashboardPage, DashboardPageHeader, DashboardPageHeaderTitle, DashboardPageMain } from '@/components/dashboard/page'
import { PropsWithChildren } from 'react'
import { PlusIcon } from "@radix-ui/react-icons"

export default function Layout({ children }: PropsWithChildren) {
return (
<DashboardPage>
<DashboardPageHeader>
<DashboardPageHeaderTitle>Veículos</DashboardPageHeaderTitle>
<DashboardPageHeaderNav>
<Button className='gap-2'>
<PlusIcon />
Cadastrar
</Button>
</DashboardPageHeaderNav>
</DashboardPageHeader>
<DashboardPageMain>
{children}
</DashboardPageMain>
</DashboardPage>

)
}
Loading

0 comments on commit 5136b45

Please sign in to comment.