diff --git a/Dockerfile b/Dockerfile index 5a77da7..cff5132 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app EXPOSE 8080 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["GeradoresWS/GeradoresWS.csproj", "GeradoresWS/"] COPY ["GeradoresService/GeradoresService.csproj", "GeradoresService/"] RUN dotnet restore "GeradoresWS/GeradoresWS.csproj" -COPY . . +COPY . . WORKDIR "/src/GeradoresWS" RUN dotnet build "GeradoresWS.csproj" -c Release -o /app/build @@ -25,7 +25,7 @@ WORKDIR /app COPY --from=publish /app/publish . # Set environment variables -ENV ASPNETCORE_URLS=http://+:8080 +ENV ASPNETCORE_URLS=http://+:8080, http://+:443 ENV ASPNETCORE_ENVIRONMENT=Production ENTRYPOINT ["dotnet", "GeradoresWS.dll"] \ No newline at end of file diff --git a/Geradores.sln b/Geradores.sln index b4ed6f4..c938927 100644 --- a/Geradores.sln +++ b/Geradores.sln @@ -5,16 +5,22 @@ VisualStudioVersion = 17.6.33829.357 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFiles", "{6370AD16-6443-4846-B933-702A86A48A19}" ProjectSection(SolutionItems) = preProject + .dockerignore = .dockerignore .gitattributes = .gitattributes .gitignore = .gitignore + docker-compose.yml = docker-compose.yml + Dockerfile = Dockerfile + Jenkinsfile = Jenkinsfile README.md = README.md EndProjectSection EndProject Project("{54A90642-561A-4BB1-A94E-469ADEE60C69}") = "geradoresfe", "geradoresfe\geradoresfe.esproj", "{1D9DDDEB-6FBA-4A9C-AE85-6A3630D8B9AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeradoresWS", "GeradoresWS\GeradoresWS.csproj", "{78B34F6D-E9C9-4FD0-A3E4-670BA401ACF6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeradoresWS", "GeradoresWS\GeradoresWS.csproj", "{78B34F6D-E9C9-4FD0-A3E4-670BA401ACF6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeradoresService", "GeradoresService\GeradoresService.csproj", "{35C4D726-3771-4D34-9A43-541588FCECAA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeradoresService", "GeradoresService\GeradoresService.csproj", "{35C4D726-3771-4D34-9A43-541588FCECAA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "UnitTest\UnitTest.csproj", "{911FEEB4-749E-43CA-9FE3-CE8334B5E0C9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -36,6 +42,10 @@ Global {35C4D726-3771-4D34-9A43-541588FCECAA}.Debug|Any CPU.Build.0 = Debug|Any CPU {35C4D726-3771-4D34-9A43-541588FCECAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {35C4D726-3771-4D34-9A43-541588FCECAA}.Release|Any CPU.Build.0 = Release|Any CPU + {911FEEB4-749E-43CA-9FE3-CE8334B5E0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {911FEEB4-749E-43CA-9FE3-CE8334B5E0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {911FEEB4-749E-43CA-9FE3-CE8334B5E0C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {911FEEB4-749E-43CA-9FE3-CE8334B5E0C9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GeradoresService/DAL/Geradore.cs b/GeradoresService/DAL/Geradore.cs new file mode 100644 index 0000000..288ba58 --- /dev/null +++ b/GeradoresService/DAL/Geradore.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +namespace GeradoresService.DAL; + +public partial class Geradore +{ + public int Id { get; set; } + + public int? Tipo { get; set; } + + public string? Valor { get; set; } +} diff --git a/GeradoresService/DAL/GeradoresContext.cs b/GeradoresService/DAL/GeradoresContext.cs new file mode 100644 index 0000000..69ae8d9 --- /dev/null +++ b/GeradoresService/DAL/GeradoresContext.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; + +namespace GeradoresService.DAL; + +public partial class GeradoresContext : DbContext +{ + public GeradoresContext() + { + } + + public GeradoresContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet Geradores { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PK__Geradore__3214EC2710D5AD88"); + + entity.Property(e => e.Id).HasColumnName("ID"); + entity.Property(e => e.Valor).HasMaxLength(50); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/GeradoresService/GeradoresService.csproj b/GeradoresService/GeradoresService.csproj index cfadb03..61429ca 100644 --- a/GeradoresService/GeradoresService.csproj +++ b/GeradoresService/GeradoresService.csproj @@ -1,9 +1,21 @@ - + - net7.0 + net8.0 enable enable + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/GeradoresService/NIF.cs b/GeradoresService/NIF.cs index c0a04d9..47bc127 100644 --- a/GeradoresService/NIF.cs +++ b/GeradoresService/NIF.cs @@ -1,10 +1,18 @@ -using System.ComponentModel; +using GeradoresService.DAL; +using System.ComponentModel; using System.Net.NetworkInformation; namespace GeradoresService { public class NIF { + private readonly GeradoresContext _geradoresContext; + + public NIF(GeradoresContext geradoresContext) + { + _geradoresContext = geradoresContext; + } + public enum NIFType { [Description("Pessoa singular (1)")] @@ -29,16 +37,14 @@ namespace GeradoresService PessoaColectivaIrregular = 9 } - /*public static GetNIFTypes(){ - EnumHelper.GetEnumValuesAndDescriptions(NIFType); - }*/ - - public static string Generate(string? type) + public string Generate(string? type) { - return GenerateRandomNIF(type); + var nif = GenerateRandomNIF(type); + //SaveNIF(nif); + return nif; } - public static string GenerateRandomNIF(string? nifType) + public string GenerateRandomNIF(string? nifType) { var firstDigitValidate = new char[] { '1', '2', '3', '5', '6', '8', '9' }; Random rnd = new Random(); @@ -86,7 +92,7 @@ namespace GeradoresService return randomNIF; } - public static bool Validate(string nif) + public bool Validate(string nif) { // Verificar se o NIF tem 9 dígitos if (nif.Length != 9) @@ -117,5 +123,16 @@ namespace GeradoresService return digitoControlo == digitos[8]; } + public void SaveNIF(string NIF) + { + var ger = new Geradore() + { + Valor = NIF + }; + + _geradoresContext.Geradores.Add(ger); + _geradoresContext.SaveChanges(); + } + } } \ No newline at end of file diff --git a/GeradoresWS/Controllers/GenerateController.cs b/GeradoresWS/Controllers/GenerateController.cs index 068d462..20850d8 100644 --- a/GeradoresWS/Controllers/GenerateController.cs +++ b/GeradoresWS/Controllers/GenerateController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using GeradoresService; +using GeradoresService.DAL; namespace GeradoresWS.Controllers { @@ -7,8 +8,13 @@ namespace GeradoresWS.Controllers [Route("[controller]")] public class GenerateController : Controller { + GeradoresContext _context; + public GenerateController(GeradoresContext context) + { + _context = context; + } + #region NIF - [HttpGet("GetNIFTypes")] public List GetNIFTypes() { @@ -18,13 +24,15 @@ namespace GeradoresWS.Controllers [HttpGet("GenerateNIF")] public string GenerateNIF(string? type) { - return NIF.Generate(type); + var nif = new NIF(_context); + return nif.Generate(type); } [HttpGet("ValidateNIF")] public bool ValidateNIF(string nif) { - return NIF.Validate(nif); + var teste = new NIF(_context); + return teste.Validate(nif); } #endregion diff --git a/GeradoresWS/Dockerfile b/GeradoresWS/Dockerfile new file mode 100644 index 0000000..ddaaf9a --- /dev/null +++ b/GeradoresWS/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build + +WORKDIR /src + +COPY ["GeradoresWS/GeradoresWS.csproj", "GeradoresWS/"] +COPY ["GeradoresService/GeradoresService.csproj", "GeradoresService/"] + +RUN dotnet restore "GeradoresWS/GeradoresWS.csproj" +COPY . . + +WORKDIR "/src/GeradoresWS" +RUN dotnet build "GeradoresWS.csproj" -c debug -o /app/build + +FROM build AS publish +RUN dotnet publish "GeradoresWS.csproj" -c debug -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . + +# Set environment variables +ENV ASPNETCORE_URLS=http://+:8080 +ENV ASPNETCORE_ENVIRONMENT=Production + +ENTRYPOINT ["dotnet", "GeradoresWS.dll"] \ No newline at end of file diff --git a/GeradoresWS/GeradoresWS.csproj b/GeradoresWS/GeradoresWS.csproj index f85e9e7..636d95f 100644 --- a/GeradoresWS/GeradoresWS.csproj +++ b/GeradoresWS/GeradoresWS.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable df357c84-88b1-4100-86d1-889166b333f7 diff --git a/GeradoresWS/Program.cs b/GeradoresWS/Program.cs index edd379c..9953e63 100644 --- a/GeradoresWS/Program.cs +++ b/GeradoresWS/Program.cs @@ -1,3 +1,6 @@ +using GeradoresService.DAL; +using Microsoft.EntityFrameworkCore; + var builder = WebApplication.CreateBuilder(args); // Add services to the container. @@ -7,13 +10,16 @@ builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); + + +var connectionString = builder.Configuration.GetConnectionString("GeradoresConnection"); +builder.Services.AddDbContext(options => options.UseSqlServer(connectionString)); + var app = builder.Build(); // Configure the HTTP request pipeline. app.UseSwagger(); app.UseSwaggerUI(); - - app.UseHttpsRedirection(); app.UseAuthorization(); diff --git a/GeradoresWS/Properties/launchSettings.json b/GeradoresWS/Properties/launchSettings.json index d4edd08..4817b93 100644 --- a/GeradoresWS/Properties/launchSettings.json +++ b/GeradoresWS/Properties/launchSettings.json @@ -32,6 +32,10 @@ "commandName": "Docker", "launchBrowser": true, "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:8080", + "ASPNETCORE_ENVIRONMENT": "Development" + }, "publishAllPorts": true, "useSSL": false } diff --git a/GeradoresWS/appsettings.json b/GeradoresWS/appsettings.json index 10f68b8..eb55d0f 100644 --- a/GeradoresWS/appsettings.json +++ b/GeradoresWS/appsettings.json @@ -5,5 +5,9 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "ConnectionStrings": { + "GeradoresConnection": "server=127.0.0.1;uid=sa;pwd=mssqlAdmin!1;database=Geradores;TrustServerCertificate=True;" + } } + \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index e39d61c..53e2b5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,12 +12,21 @@ pipeline { environment { now = new Date().format('yyyyMMdd-HHmm', TimeZone.getTimeZone('UTC')) + + DOCKER_IMAGE = 'GeradoresWs/api' + DOCKER_TAG = "${env.BUILD_ID}" + DOCKER_REGISTRY = 'Shini89' + REMOTE_DOCKER_HOST = '192.168.2.20' + REMOTE_DOCKER_USER = 'admin' + REMOTE_DOCKER_PORT = '2375' + + REACT_DIR = 'geradoresfe' // Diret�rio do frontend React + SERVICE_DIR = 'GeradoresService' // Diret�rio do projeto DLL + API_DIR = 'GeradoresWS' // Diret�rio do Web API + DOCKER_REGISTRY = 'your-docker-registry.com' // Registro Docker } stages { - /******************************************************* - Stage BUILD - *******************************************************/ stage('Check for Changes') { steps { script { @@ -43,12 +52,20 @@ pipeline { } } + stage('Checkout Code') { + steps { + git branch: 'master', url: 'https://git.homeware.pt/Marco/Geradores.git' + } + } /******************************************************* Stage BUILD *******************************************************/ - stage('Build') { + stage('Build Service DLL') { steps { - echo 'Construindo o projeto...' + echo 'Building Business Logic DLL...' + dir("${env.SERVICE_DIR}") { + sh 'dotnet build -c Release' + } } } } diff --git a/UnitTest/DB.cs b/UnitTest/DB.cs new file mode 100644 index 0000000..631d94b --- /dev/null +++ b/UnitTest/DB.cs @@ -0,0 +1,38 @@ +using GeradoresService; +using GeradoresService.DAL; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; + +namespace UnitTest +{ + public class DB + { + + private readonly GeradoresContext _context; + public DB() + { + + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .Build(); + + // Obter a connection string a partir do arquivo de configuração + var connectionString = configuration.GetConnectionString("GeradoresConnection"); + + // Configurar o DbContext para usar o InMemoryDatabase + var options = new DbContextOptionsBuilder() + .UseSqlServer(connectionString) + .Options; + + _context = new GeradoresContext(options); + } + + [Fact] + public void GenerateNIF() + { + var nif = new NIF(_context); + var gerenatednif = nif.Generate("2"); + Assert.NotEmpty(gerenatednif); + } + } +} \ No newline at end of file diff --git a/UnitTest/UnitTest.csproj b/UnitTest/UnitTest.csproj new file mode 100644 index 0000000..4e4a75c --- /dev/null +++ b/UnitTest/UnitTest.csproj @@ -0,0 +1,54 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/UnitTest/appsettings.Development.json b/UnitTest/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/UnitTest/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/UnitTest/appsettings.json b/UnitTest/appsettings.json new file mode 100644 index 0000000..eb55d0f --- /dev/null +++ b/UnitTest/appsettings.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "GeradoresConnection": "server=127.0.0.1;uid=sa;pwd=mssqlAdmin!1;database=Geradores;TrustServerCertificate=True;" + } +} + \ No newline at end of file diff --git a/geradoresfe/package.json b/geradoresfe/package.json index 8d67f91..6910eb4 100644 --- a/geradoresfe/package.json +++ b/geradoresfe/package.json @@ -5,6 +5,8 @@ "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", + "@headlessui/react": "^2.2.0", + "@heroicons/react": "^2.1.5", "@mui/icons-material": "^5.15.15", "@mui/material": "^5.15.15", "@testing-library/jest-dom": "^5.17.0", @@ -50,6 +52,7 @@ "@types/react-helmet": "^6.1.11", "eslint": "^8.57.0", "eslint-config-react-app": "^7.0.1", - "jest-editor-support": "^31.1.2" + "jest-editor-support": "^31.1.2", + "tailwindcss": "^3.4.13" } } diff --git a/geradoresfe/src/App.tsx b/geradoresfe/src/App.tsx index 7bded8c..24ac99e 100644 --- a/geradoresfe/src/App.tsx +++ b/geradoresfe/src/App.tsx @@ -1,99 +1,20 @@ -import * as React from 'react'; -import { PaletteMode } from '@mui/material'; -import CssBaseline from '@mui/material/CssBaseline'; -import Box from '@mui/material/Box'; -import Divider from '@mui/material/Divider'; -import { ThemeProvider, createTheme } from '@mui/material/styles'; -import ToggleButton from '@mui/material/ToggleButton'; -import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; - -import { Helmet } from 'react-helmet'; -import getLPTheme from './GeradoresTheme'; - -import AppAppBar from './components/AppAppBar'; +import React from 'react'; +import Navbar from './components/Navbar'; import Hero from './components/Hero'; -import LogoCollection from './components/LogoCollection'; -import Highlights from './components/Highlights'; -import Pricing from './components/Pricing'; -import Features from './components/Features'; -import Testimonials from './components/Testimonials'; -import FAQ from './components/FAQ'; +import FeatureSection from './components/Features'; import Footer from './components/Footer'; -import GeradorCC from './components/GeradorNIF'; - - -interface ToggleCustomThemeProps { - showCustomTheme: Boolean; - toggleCustomTheme: () => void; -} - -function ToggleCustomTheme({ - showCustomTheme, - toggleCustomTheme, -}: ToggleCustomThemeProps) { +const App = () => { return ( - - - - - Custom theme - - Material Design 2 - - - ); -} -function App() { - /*const [mode, setMode] = React.useState('light'); - const [showCustomTheme, setShowCustomTheme] = React.useState(true); - const LPtheme = createTheme(getLPTheme(mode)); - const defaultTheme = createTheme({ palette: { mode } }); - - const toggleColorMode = () => { - setMode((prev) => (prev === 'dark' ? 'light' : 'dark')); - }; - - const toggleCustomTheme = () => { - setShowCustomTheme((prev) => !prev); - };*/ - - return ( -
- - - Geradores - - { /**/} -
- - -
- - +
+ +
+ + +
+
); -} +}; export default App; diff --git a/geradoresfe/src/assets/logotio.jfif b/geradoresfe/src/assets/logotio.jfif new file mode 100644 index 0000000..8c037a6 Binary files /dev/null and b/geradoresfe/src/assets/logotio.jfif differ diff --git a/geradoresfe/src/assets/logotipo.png b/geradoresfe/src/assets/logotipo.png new file mode 100644 index 0000000..061270f Binary files /dev/null and b/geradoresfe/src/assets/logotipo.png differ diff --git a/geradoresfe/src/assets/logotipo_transparent.png b/geradoresfe/src/assets/logotipo_transparent.png new file mode 100644 index 0000000..47b1939 Binary files /dev/null and b/geradoresfe/src/assets/logotipo_transparent.png differ diff --git a/geradoresfe/src/components/AppAppBar.tsx b/geradoresfe/src/components/AppAppBar.tsx deleted file mode 100644 index d0b2a9b..0000000 --- a/geradoresfe/src/components/AppAppBar.tsx +++ /dev/null @@ -1,227 +0,0 @@ -import * as React from 'react'; -import { PaletteMode } from '@mui/material'; -import Box from '@mui/material/Box'; -import AppBar from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import Button from '@mui/material/Button'; -import IconButton from '@mui/material/IconButton'; -import Container from '@mui/material/Container'; -import Divider from '@mui/material/Divider'; -import MenuItem from '@mui/material/MenuItem'; -import Drawer from '@mui/material/Drawer'; -import MenuIcon from '@mui/icons-material/Menu'; -import CloseRoundedIcon from '@mui/icons-material/CloseRounded'; -import ToggleColorMode from './ToggleColorMode'; - -import Sitemark from './SitemarkIcon'; - -interface AppAppBarProps { - mode: PaletteMode; - toggleColorMode: () => void; -} - -export default function AppAppBar({ mode, toggleColorMode }: AppAppBarProps) { - const [open, setOpen] = React.useState(false); - - const toggleDrawer = (newOpen: boolean) => () => { - setOpen(newOpen); - }; - - const scrollToSection = (sectionId: string) => { - const sectionElement = document.getElementById(sectionId); - const offset = 128; - if (sectionElement) { - const targetScroll = sectionElement.offsetTop - offset; - sectionElement.scrollIntoView({ behavior: 'smooth' }); - window.scrollTo({ - top: targetScroll, - behavior: 'smooth', - }); - setOpen(false); - } - }; - - return ( - - - ({ - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - flexShrink: 0, - borderRadius: '999px', - bgcolor: - theme.palette.mode === 'light' - ? 'hsla(220, 60%, 99%, 0.6)' - : 'hsla(220, 0%, 0%, 0.7)', - backdropFilter: 'blur(24px)', - maxHeight: 40, - border: '1px solid', - borderColor: 'divider', - boxShadow: - theme.palette.mode === 'light' - ? '0 1px 2px hsla(210, 0%, 0%, 0.05), 0 2px 12px hsla(210, 100%, 80%, 0.5)' - : '0 1px 2px hsla(210, 0%, 0%, 0.5), 0 2px 12px hsla(210, 100%, 25%, 0.3)', - })} - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - scrollToSection('features')}> - Features - - scrollToSection('testimonials')}> - Testimonials - - scrollToSection('highlights')}> - Highlights - - scrollToSection('pricing')}> - Pricing - - scrollToSection('faq')}>FAQ - - - - - - - - - - - - - ); -} diff --git a/geradoresfe/src/components/Features.tsx b/geradoresfe/src/components/Features.tsx index f02afaa..cc31240 100644 --- a/geradoresfe/src/components/Features.tsx +++ b/geradoresfe/src/components/Features.tsx @@ -1,272 +1,27 @@ -import * as React from 'react'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import Card from '@mui/material/Card'; -import Chip from '@mui/material/Chip'; -import Container from '@mui/material/Container'; -import Grid from '@mui/material/Grid'; -import Link from '@mui/material/Link'; -import Stack from '@mui/material/Stack'; -import Typography from '@mui/material/Typography'; -import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; -import DevicesRoundedIcon from '@mui/icons-material/DevicesRounded'; -import EdgesensorHighRoundedIcon from '@mui/icons-material/EdgesensorHighRounded'; -import ViewQuiltRoundedIcon from '@mui/icons-material/ViewQuiltRounded'; +import React from 'react'; -const items = [ - { - icon: , - title: 'Dashboard', - description: - 'This item could provide a snapshot of the most important metrics or data points related to the product.', - imageLight: 'url("/static/images/templates/templates-images/dash-light.png")', - imageDark: 'url("/static/images/templates/templates-images/dash-dark.png")', - }, - { - icon: , - title: 'Mobile integration', - description: - 'This item could provide information about the mobile app version of the product.', - imageLight: 'url("/static/images/templates/templates-images/mobile-light.png")', - imageDark: 'url("/static/images/templates/templates-images/mobile-dark.png")', - }, - { - icon: , - title: 'Available on all platforms', - description: - 'This item could let users know the product is available on all platforms, such as web, mobile, and desktop.', - imageLight: 'url("/static/images/templates/templates-images/devices-light.png")', - imageDark: 'url("/static/images/templates/templates-images/devices-dark.png")', - }, -]; +function FeatureSection() { + return ( +
+
+

Why Use Our Generator?

+
+
+

NIF (Número Identificação Fiscal)

+

Quickly generate valid Portuguese Tax Identification Numbers (NIF) for testing.

+
+
+

NISS (Número Identificação Segurança Social)

+

Create Portuguese Social Security Numbers (NISS) easily with one click.

+
+
+

Cartão de Cidadão

+

Generate valid Citizen Card numbers for testing purposes in a few seconds.

+
+
+
+
+ ); +}; -export default function Features() { - const [selectedItemIndex, setSelectedItemIndex] = React.useState(0); - - const handleItemClick = (index: number) => { - setSelectedItemIndex(index); - }; - - const selectedFeature = items[selectedItemIndex]; - - return ( - - - -
- - Product features - - - Provide a brief overview of the key features of the product. For - example, you could list the number of features, their types or - benefits, and add-ons. - -
- - {items.map(({ title }, index) => ( - handleItemClick(index)} - sx={(theme) => ({ - ...(selectedItemIndex === index && { - borderColor: - theme.palette.mode === 'light' - ? 'primary.light' - : 'primary.dark', - background: - 'linear-gradient(to bottom right, hsl(210, 98%, 48%), hsl(210, 98%, 35%))', - color: 'hsl(0, 0%, 100%)', - '& .MuiChip-label': { - color: 'hsl(0, 0%, 100%)', - }, - }), - })} - /> - ))} - - - - theme.palette.mode === 'light' - ? items[selectedItemIndex].imageLight - : items[selectedItemIndex].imageDark, - backgroundSize: 'cover', - backgroundPosition: 'center', - minHeight: 280, - }} - /> - - - {selectedFeature.title} - - - {selectedFeature.description} - - svg': { transition: '0.2s' }, - '&:hover > svg': { transform: 'translateX(2px)' }, - }} - > - Learn more - - - - - - {items.map(({ icon, title, description }, index) => ( - handleItemClick(index)} - sx={(theme) => ({ - p: 3, - height: 'fit-content', - width: '100%', - background: 'none', - ...(selectedItemIndex === index && { - backgroundColor: 'action.selected', - borderColor: - theme.palette.mode === 'light' - ? 'primary.light' - : 'primary.dark', - }), - '&:hover': { - background: - theme.palette.mode === 'light' - ? 'linear-gradient(to bottom right, hsla(210, 100%, 97%, 0.5) 25%, hsla(210, 100%, 90%, 0.3) 100%)' - : 'linear-gradient(to right bottom, hsla(210, 100%, 12%, 0.2) 25%, hsla(210, 100%, 16%, 0.2) 100%)', - borderColor: - theme.palette.mode === 'light' - ? 'primary.light' - : 'primary.dark', - boxShadow: - theme.palette.mode === 'light' - ? '0px 2px 8px hsla(0, 0%, 0%, 0.1)' - : '0px 1px 8px hsla(210, 100%, 25%, 0.5) ', - }, - })} - > - - ({ - color: - theme.palette.mode === 'light' ? 'grey.400' : 'grey.600', - ...(selectedItemIndex === index && { - color: 'primary.main', - }), - })} - > - {icon} - -
- - {title} - - - {description} - - svg': { transition: '0.2s' }, - '&:hover > svg': { transform: 'translateX(2px)' }, - }} - onClick={(event) => { - event.stopPropagation(); - }} - > - Learn more - - -
-
-
- ))} -
-
- - - - theme.palette.mode === 'light' - ? items[selectedItemIndex].imageLight - : items[selectedItemIndex].imageDark, - }} - /> - - -
-
- ); -} +export default FeatureSection; diff --git a/geradoresfe/src/components/Footer.tsx b/geradoresfe/src/components/Footer.tsx index d635e85..cc28d4d 100644 --- a/geradoresfe/src/components/Footer.tsx +++ b/geradoresfe/src/components/Footer.tsx @@ -1,215 +1,16 @@ -import * as React from 'react'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import Container from '@mui/material/Container'; -import IconButton from '@mui/material/IconButton'; -import InputLabel from '@mui/material/InputLabel'; -import Link from '@mui/material/Link'; -import Stack from '@mui/material/Stack'; -import TextField from '@mui/material/TextField'; -import Typography from '@mui/material/Typography'; +import React from 'react'; -import { visuallyHidden } from '@mui/utils'; +const Footer = () => { + return ( + + ); +}; -import FacebookIcon from '@mui/icons-material/GitHub'; -import LinkedInIcon from '@mui/icons-material/LinkedIn'; -import TwitterIcon from '@mui/icons-material/X'; - -import SitemarkIcon from './SitemarkIcon'; - -function Copyright() { - return ( - - {'Copyright © '} - Sitemark  - {new Date().getFullYear()} - - ); -} - -export default function Footer() { - return ( - - - - - - - Join the newsletter - - - Subscribe for weekly updates. No spams ever! - - - - Email - - - - - - - - - Product - - - Features - - - Testimonials - - - Highlights - - - Pricing - - - FAQs - - - - - Company - - - About us - - - Careers - - - Press - - - - - Legal - - - Terms - - - Privacy - - - Contact - - - - -
- - Privacy Policy - - -  â€¢  - - - Terms of Service - - -
- - - - - - - - - - - -
-
- ); -} +export default Footer; diff --git a/geradoresfe/src/components/Hero.tsx b/geradoresfe/src/components/Hero.tsx index a8e9b21..f2287e0 100644 --- a/geradoresfe/src/components/Hero.tsx +++ b/geradoresfe/src/components/Hero.tsx @@ -1,132 +1,23 @@ -import * as React from 'react'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import Container from '@mui/material/Container'; -import InputLabel from '@mui/material/InputLabel'; -import Link from '@mui/material/Link'; -import Stack from '@mui/material/Stack'; -import TextField from '@mui/material/TextField'; -import Typography from '@mui/material/Typography'; +import React from 'react'; -import { visuallyHidden } from '@mui/utils'; +function Hero(){ + return ( +
+
+

+ Generate Your NIF, NISS, and Cartão de Cidadão Easily +

+

+ Use our simple and efficient platform to generate valid testing numbers quickly. +

+ +
+
+ ); +}; -export default function Hero() { - return ( - ({ - width: '100%', - backgroundImage: - theme.palette.mode === 'light' - ? 'radial-gradient(ellipse 80% 50% at 50% -20%, hsl(210, 100%, 90%), transparent)' - : 'radial-gradient(ellipse 80% 50% at 50% -20%, hsl(210, 100%, 16%), transparent)', - backgroundRepeat: 'no-repeat', - })} - > - - - - Our latest  - - theme.palette.mode === 'light' ? 'primary.main' : 'primary.light', - }} - > - products - - - - Explore our cutting-edge dashboard, delivering high-quality solutions - tailored to your needs. Elevate your experience with top-tier features - and services. - - - - Email - - - - - - By clicking "Start now" you agree to our  - - Terms & Conditions - - . - - - ({ - mt: { xs: 8, sm: 10 }, - alignSelf: 'center', - height: { xs: 200, sm: 700 }, - width: '100%', - backgroundImage: - theme.palette.mode === 'light' - ? 'url("/static/images/templates/templates-images/hero-light.png")' - : 'url("/static/images/templates/templates-images/hero-dark.png")', - backgroundSize: 'cover', - borderRadius: '12px', - outline: '1px solid', - outlineColor: - theme.palette.mode === 'light' - ? 'hsla(220, 25%, 80%, 0.5)' - : 'hsla(210, 100%, 80%, 0.1)', - boxShadow: - theme.palette.mode === 'light' - ? '0 0 12px 8px hsla(220, 25%, 80%, 0.2)' - : '0 0 24px 12px hsla(210, 100%, 25%, 0.2)', - })} - /> - - - ); -} +export default Hero; diff --git a/geradoresfe/src/components/Navbar.tsx b/geradoresfe/src/components/Navbar.tsx new file mode 100644 index 0000000..ee2c407 --- /dev/null +++ b/geradoresfe/src/components/Navbar.tsx @@ -0,0 +1,108 @@ +import React, { useState, useEffect } from 'react'; +import { Transition } from '@headlessui/react'; +import { MoonIcon, SunIcon } from '@heroicons/react/24/outline'; +import Logo from '../assets/logotipo.png'; + + +const Navbar = () => { + const [isOpen, setIsOpen] = useState(false); + const [darkMode, setDarkMode] = useState(false); + + // Apply dark mode based on the toggle state + useEffect(() => { + if (darkMode) { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.remove('dark'); + } + }, [darkMode]); + + return ( + + ); +}; + +export default Navbar; \ No newline at end of file diff --git a/geradoresfe/src/index.css b/geradoresfe/src/index.css index ec2585e..b5c61c9 100644 --- a/geradoresfe/src/index.css +++ b/geradoresfe/src/index.css @@ -1,13 +1,3 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/geradoresfe/src/index.tsx b/geradoresfe/src/index.tsx index 935d4ba..4423804 100644 --- a/geradoresfe/src/index.tsx +++ b/geradoresfe/src/index.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; -import { Helmet } from 'react-helmet' +//import { Helmet } from 'react-helmet' const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement diff --git a/geradoresfe/tailwind.config.js b/geradoresfe/tailwind.config.js new file mode 100644 index 0000000..a16363e --- /dev/null +++ b/geradoresfe/tailwind.config.js @@ -0,0 +1,11 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + darkMode: 'class', // Enable dark mode with a class + content: [ + "./src/**/*.{js,jsx,ts,tsx}", + ], + theme: { + extend: {}, + }, + plugins: [], +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6cb6b54 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "Geradores", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{}