Skip to content

Commit

Permalink
Merge pull request #6 from kovarike/website-feature
Browse files Browse the repository at this point in the history
add new template for backend and update profile dowload fun
  • Loading branch information
kovarike authored Sep 9, 2024
2 parents 96b2725 + bf37d44 commit f1de177
Show file tree
Hide file tree
Showing 27 changed files with 4,275 additions and 2,963 deletions.
Empty file removed .npmrc
Empty file.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Clique em New repository secret e adicione um novo segredo com um nome (por exem
1. **Testar Localmente**: Certifique-se de que sua aplicação funciona conforme esperado localmente com `npm run build` e `npm start` para garantir que não há problemas antes de fazer o deploy.

2. **Integrar com Vercel**:

- **Conectar Repositório**: Conecte seu repositório GitHub à Vercel.
- **Configurações do Projeto**: Na Vercel, você pode ajustar configurações específicas do projeto se necessário, mas normalmente as configurações padrão funcionam bem.

Expand Down
23 changes: 13 additions & 10 deletions apps/algorithms/public/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
interface LogoProps extends React.SVGProps<SVGSVGElement> { }
interface LogoProps extends React.SVGProps<SVGSVGElement> {}

export const Logo: React.FC<LogoProps> = (props: LogoProps) => {


return (

<svg width={150} height={50} className="rounded-md" xmlns="http://www.w3.org/2000/svg" {...props} >
<svg
width={150}
height={50}
className="rounded-md"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<rect width="100%" height="100%" fill="#000" />
<text
x="50%" // Centraliza horizontalmente
y="50%" // Centraliza verticalmente
textAnchor="middle" // Alinha o texto ao meio horizontalmente
dominantBaseline="middle" // Alinha o texto ao meio verticalmente
x="50%" // Centraliza horizontalmente
y="50%" // Centraliza verticalmente
textAnchor="middle" // Alinha o texto ao meio horizontalmente
dominantBaseline="middle" // Alinha o texto ao meio verticalmente
fontFamily="Inter, sans-serif"
fontSize={24}
fill="#00FF00"
Expand All @@ -21,5 +24,5 @@ export const Logo: React.FC<LogoProps> = (props: LogoProps) => {
</tspan>
</text>
</svg>
)
);
};
5 changes: 1 addition & 4 deletions apps/algorithms/public/logoanimated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { motion, SVGMotionProps } from "framer-motion";
import React, { useEffect, useState } from "react";

interface LogoProps extends SVGMotionProps<SVGSVGElement> { }
interface LogoProps extends SVGMotionProps<SVGSVGElement> {}

export const LogoAnimated: React.FC<LogoProps> = (props: LogoProps) => {
const [mounted, setMounted] = useState(false);
Expand Down Expand Up @@ -38,6 +38,3 @@ export const LogoAnimated: React.FC<LogoProps> = (props: LogoProps) => {
</motion.svg>
);
};



24 changes: 17 additions & 7 deletions apps/algorithms/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";


const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
Expand Down Expand Up @@ -36,7 +35,6 @@ export const metadata: Metadata = {
},
};


export default function RootLayout({
children,
}: Readonly<{
Expand All @@ -51,17 +49,29 @@ export default function RootLayout({
<meta name="author" content="Danilo Silva" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Algorithms | Engineering" />
<meta property="og:description" content="Explore the world of engineering and technology with Algorithms." />
<meta property="og:image" content={`https://algorithmss.com.br/logo.png`} />
<meta
property="og:description"
content="Explore the world of engineering and technology with Algorithms."
/>
<meta
property="og:image"
content={`https://algorithmss.com.br/logo.png`}
/>
<meta property="og:url" content="https://algorithmss.com.br" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Algorithms | Engineering" />
<meta name="twitter:description" content="Stay informed with the latest trends in engineering." />
<meta name="twitter:image" content={`https://algorithmss.com.br/twitter-logo.png`} />
<meta
name="twitter:description"
content="Stay informed with the latest trends in engineering."
/>
<meta
name="twitter:image"
content={`https://algorithmss.com.br/twitter-logo.png`}
/>
<link rel="canonical" href="https://algorithmss.com.br" />
</head>

<body className={`${inter.className} bg-zinc-950`} >{children}</body>
<body className={`${inter.className} bg-zinc-950`}>{children}</body>
</html>
);
}
2 changes: 0 additions & 2 deletions apps/algorithms/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { ContainerFull } from "@/components/containerfull";
import { Header } from "@/components/header";
import { Link } from "@/components/link";
Expand Down
13 changes: 7 additions & 6 deletions apps/algorithms/src/app/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use server";
import React from "react";
import { v4 as uuidv4 } from 'uuid';
import { v4 as uuidv4 } from "uuid";
import { Avatar } from "@/components/avatar";
import { Container } from "@/components/container";
import { ContainerFull } from "@/components/containerfull";
import { Header } from "@/components/header";
import { Link } from "@/components/link";
Expand All @@ -11,17 +10,19 @@ import { Img } from "@/components/img";
import { ProfileInf } from "./profileinf";
import { Translate } from "@/components/translate";


export default async function Profile() {
const { profile, social_media } = await ProfileInf();
const id = uuidv4();


return (
<>
<ContainerFull>
<Header />
<Container>
<div className="flex items-center border-b border-slate-500 py-1" id={id}>
<div className="my-0 mx-auto mx-full p-6 bg-white text-slate-800" id={id}>
<div
className="flex items-center border-b border-slate-500 py-1"
>
<Avatar alt="Danilo" border size="Xlarge" src={profile.src} />
<div className="text-center mx-auto space-y-4 max-w-auto w-auto">
<h2 className="text-3xl font-semibold font-algorithms-font">
Expand Down Expand Up @@ -64,7 +65,7 @@ export default async function Profile() {
<Img src={profile.github} alt="github" />
</div>
</div>
</Container>
</div>
</ContainerFull>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/algorithms/src/app/profile/profileinf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use server"
"use server";

export async function ProfileInf() {
const profileInf = {
Expand Down
3 changes: 1 addition & 2 deletions apps/algorithms/src/app/profile/text.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import { HTMLAttributes } from "react";

interface TextProps extends HTMLAttributes<HTMLParagraphElement> { }
interface TextProps extends HTMLAttributes<HTMLParagraphElement> {}

export function Text(props: TextProps) {
return (
Expand Down
13 changes: 10 additions & 3 deletions apps/algorithms/src/components/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ const sizeClasses = {
export function Avatar({ src, alt, size, border }: AvatarProps) {
return (
<div
className={`relative inline-flex items-center justify-center ${sizeClasses[size]} ${border ? "border-2 border-gray-300" : ""
} rounded-full overflow-hidden bg-gray-200 w-auto`}
className={`relative inline-flex items-center justify-center ${sizeClasses[size]} ${
border ? "border-2 border-gray-300" : ""
} rounded-full overflow-hidden bg-gray-200 w-auto`}
>
{src ? (
<img src={src} alt={alt} className="object-cover w-full h-full" width={24} height={24} />
<img
src={src}
alt={alt}
className="object-cover w-full h-full"
width={24}
height={24}
/>
) : (
<span className="text-gray-600">{alt?.charAt(0).toUpperCase()}</span>
)}
Expand Down
6 changes: 4 additions & 2 deletions apps/algorithms/src/components/container.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
interface ContainerProps {
children?: React.ReactNode;


}

export function Container({ children }: ContainerProps) {
export function Container({ children}: ContainerProps) {
return (
<div className="my-0 mx-auto mx-full p-6 bg-white text-black">
<div className="my-0 mx-auto mx-full p-6 bg-zinc-950 text-white" >
{children}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/algorithms/src/components/containerfull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ContainerProps {

export function ContainerFull({ children }: ContainerProps) {
return (
<div className="w-full px-4 sm:px-6 md:px-8 lg:px-10 xl:px-12 mx-auto max-w-7xl h-screen">
<div className="w-full px-4 sm:px-6 md:px-8 lg:px-10 xl:px-12 mx-auto max-w-7xl h-screen bg-zinc-950 text-white">
{children}
</div>
);
Expand Down
10 changes: 4 additions & 6 deletions apps/algorithms/src/components/download.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
"use client"
"use client";
import { ArrowDownToLine } from "lucide-react";
import { toPng } from 'html-to-image';
import { toPng } from "html-to-image";

interface PropsDownload {
id: string,

id: string;
}


export function Download({ id }: PropsDownload) {
const download = async () => {
const svgElement = document.getElementById(id); // Usando o id para acessar o SVG
if (svgElement) {
try {
const dataUrl = await toPng(svgElement);
const link = document.createElement('a');
const link = document.createElement("a");
link.href = dataUrl;
link.download = `${id}.png`;
document.body.appendChild(link);
Expand Down
2 changes: 0 additions & 2 deletions apps/algorithms/src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Logo } from "../../public/logo";


interface HeaderProps {
children?: React.ReactNode;
}

export function Header({ children }: HeaderProps) {
return (

<header className="bg-zinc-950 text-white py-5 text-center my-0 w-full px-4 sm:px-6 md:px-8 lg:px-10 xl:px-12 mx-auto max-w-7xl max-h-20">
<h1 className="flex text-3xl justify-center items-center font-bold">
<Logo />
Expand Down
9 changes: 8 additions & 1 deletion apps/algorithms/src/components/img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ interface ImgProps extends HTMLAttributes<HTMLImageElement> {
export function Img({ src, props, alt, height, width }: ImgProps) {
return (
<>
<img src={src} alt={alt} {...props} height={height} width={width} className="object-cover" />
<img
src={src}
alt={alt}
{...props}
height={height}
width={width}
className="object-cover"
/>
</>
);
}
15 changes: 3 additions & 12 deletions apps/algorithms/src/components/translate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@ import { Download } from "./download";
import React from "react";

interface PropsTranslate {
id: string,

id: string;
}

export function Translate({ id }: PropsTranslate) {


return (
<div className="max-w-20 w-20">
<div className="flex items-center mx-auto my-0">
<button

className="w-7 h-7 px-1 text-gray-600 bg-algorithms-color/20 hover:bg-algorithms-color/45 rounded-l-md text-center"
>
<button className="w-7 h-7 px-1 text-gray-600 bg-algorithms-color/20 hover:bg-algorithms-color/45 rounded-l-md text-center">
pt
</button>
<button

className="w-7 h-7 px-1 text-gray-600 bg-algorithms-color/20 hover:bg-algorithms-color/45 text-center"
>
<button className="w-7 h-7 px-1 text-gray-600 bg-algorithms-color/20 hover:bg-algorithms-color/45 text-center">
en
</button>
<Download id={id} />
Expand Down
6 changes: 1 addition & 5 deletions apps/engine/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# prod
dist/

# dev
.vercel/
.yarn/
!.yarn/releases
.vscode/*
Expand All @@ -13,12 +11,10 @@ dist/

# deps
node_modules/
.wrangler

# env
.env
.env.production
.dev.vars

# logs
logs/
Expand Down
6 changes: 1 addition & 5 deletions apps/engine/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
```
npm install
npm run dev
```

```
npm run deploy
npm run start
```
14 changes: 14 additions & 0 deletions apps/engine/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Hono } from "hono";
import { handle } from "hono/vercel";

export const config = {
runtime: "edge",
};

const app = new Hono().basePath("/api");

app.get("/", (c) => {
return c.json({ message: "Hello Hono!" });
});

export default handle(app);
16 changes: 6 additions & 10 deletions apps/engine/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"name": "@algorithms/engine",
"name": "engine",
"scripts": {
"dev": "wrangler dev src/index.ts",
"deploy": "wrangler deploy --minify src/index.ts"
"start": "vercel dev",
"deploy": "vercel"
},
"dependencies": {
"@hono/zod-openapi": "^0.16.0",
"@hono/zod-validator": "^0.2.2",
"hono": "^4.5.11",
"zod": "^3.23.8"
"hono": "^4.5.11"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240529.0",
"wrangler": "^3.57.2"
"vercel": "^32.4.1"
}
}
}
12 changes: 0 additions & 12 deletions apps/engine/src/index.ts

This file was deleted.

Loading

0 comments on commit f1de177

Please sign in to comment.