diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b1d73e4 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,38 @@ +# Repository Guidelines + +## Project Structure & Module Organization +- `src/app/`: Next.js App Router. Routes: `blog/`, `articles/`, `projects/`, `about/`, `services/`, `thanks/`. +- `src/app/components/`: Reusable UI (e.g., `Navbar/`, `Footer/`, `ArticleCard/`, `ContactForm/`). Use one component per folder with `index.tsx`. +- `src/data/`, `src/utils/`: Static data and helpers (e.g., `content.ts`). +- `public/`: Static assets, `robots.txt`, `sitemap.xml`. Served at site root. +- `out/`: Static export output for deployment (don’t edit manually). +- Config: `next.config.ts`, `tailwind.config.ts`, `eslint.config.mjs`, `.htaccess`. + +## Build, Test, and Development Commands +- `npm run dev`: Dev server with Turbopack at `http://localhost:3000`. +- `npm run build`: Production build. If using static hosting, enable `output: 'export'` in `next.config.ts` to generate `out/`. +- `npm start`: Run the production server locally. +- `npm run lint`: ESLint (Next core-web-vitals + TS). Auto-fix: `npm run lint -- --fix`. +- Preview static build: `npx http-server ./out -p 8000`. + +## Coding Style & Naming Conventions +- TypeScript; 2-space indent. Components in PascalCase; route segments lowercase (e.g., `src/app/blog/page.tsx`). +- Tailwind CSS in JSX; shared styles in `src/app/globals.css`. +- Keep pages self-contained with `metadata.ts` per route when relevant. + +## Testing Guidelines +- No tests configured. Validate via `npm run dev`. If adding tests: Jest + Testing Library for unit/UI; Playwright for e2e. Place under `src/**/__tests__` or as `*.test.ts(x)`. + +## Commit & Pull Request Guidelines +- Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `refactor:`). Example: `feat(services): add static contact form`. +- PRs: clear description, linked issues, screenshots for UI, and confirm `npm run lint`/`build` pass. + +## SEO & Content +- Global SEO in `src/app/layout.tsx` (Open Graph, Twitter, JSON-LD). Per-page metadata in `src/app/**/metadata.ts`. +- Keep a single H1 por página; use descrições objetivas e CTAs claros. +- Atualize `sitemap.xml`/`robots.txt` ao criar rotas novas (ou migre para `src/app/sitemap.ts` e `robots.ts`). +- Prefira imagens OG 1200x630 em `public/images/` e referencie em metadata. + +## Contato (Formulário Estático) +- `ContactForm` usa FormSubmit (sem backend). Para trocar e-mail, edite `action` no componente. +- Redireciona para `/thanks`. Honeypot ativado; sem captcha por padrão. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b2980c0 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +SHELL := /bin/bash + +# Config +PORT ?= 8000 +HOST ?= 127.0.0.1 + +.PHONY: help install dev build serve build-serve + +## help: Show available targets +help: + @grep -E '^##' Makefile | sed -E 's/## //' | column -t -s ':' + +## install: Install project dependencies (npm ci fallback to npm install) +install: + npm ci || npm install + +## dev: Run Next.js in development mode at http://localhost:3000 +dev: + npm run dev + +## build: Build production (static export expected into ./out) +build: + npm run build + +## serve: Serve the static ./out folder on $(HOST):$(PORT) +serve: + npx http-server ./out -a $(HOST) -p $(PORT) -c-1 + +## build-serve: Build then serve the static ./out folder +build-serve: + npm run build && npx http-server ./out -a $(HOST) -p $(PORT) -c-1 + diff --git a/README.md b/README.md index b59e3bc..1548890 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ O HelpDev é um portal dedicado a compartilhar conhecimento sobre desenvolviment 1. Clone o repositório: ```bash -git clone https://github.com/seu-usuario/helpdev.git -cd helpdev +git clone https://github.com/gbzarelli/helpdev.com.br.git +cd helpdev.com.br ``` 2. Instale as dependências: @@ -89,7 +89,7 @@ O projeto inclui um arquivo `.htaccess` com as seguintes configurações: ## 📝 Estrutura do Projeto ``` -helpdev/ +helpdev.com.br/ ├── src/ │ ├── app/ │ │ ├── components/ diff --git a/next.config.ts b/next.config.ts index 469a91b..9b0d938 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({ }); const nextConfig: NextConfig = { + output: 'export', experimental: { // Enable Turbopack optimizations serverComponentsHmrCache: true, // Cache Server Components across HMR @@ -21,6 +22,7 @@ const nextConfig: NextConfig = { // Image optimization configuration images: { + unoptimized: true, remotePatterns: [ { protocol: 'https', diff --git a/package.json b/package.json index 558963e..0662d63 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build": "next build", "start": "next start", "lint": "next lint", - "analyze": "ANALYZE=true npm run build" + "analyze": "ANALYZE=true npm run build", + "serve:static": "npx http-server ./out -p 8000", + "build:serve": "npm run build && npx http-server ./out -p 8000" }, "dependencies": { "next": "15.3.0", diff --git a/src/app/components/ContactForm/index.tsx b/src/app/components/ContactForm/index.tsx new file mode 100644 index 0000000..db92f99 --- /dev/null +++ b/src/app/components/ContactForm/index.tsx @@ -0,0 +1,118 @@ +import React from 'react'; + +type Props = { + redirectPath?: string; + subject?: string; +}; + +export function ContactForm({ + redirectPath = '/thanks', + subject = 'Novo contato - Proposta | HelpDev', +}: Props) { + const actionUrl = 'https://formsubmit.co/gbzarelli@helpdev.com.br'; + + return ( +
+ {/* FormSubmit configuration */} + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+ +