Skip to content

Commit

Permalink
Merge branch 'main' into dockerize/bluesky-job-poster
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisfp0 authored Sep 25, 2024
2 parents 8d4f216 + 8876cf0 commit 40cfc42
Show file tree
Hide file tree
Showing 10 changed files with 2,406 additions and 2,409 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Trampar de Casa 💻🏠

[![Better Stack Badge](https://uptime.betterstack.com/status-badges/v3/monitor/1kmif.svg)](https://uptime.betterstack.com/?utm_source=status_badge)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/ocodista/trampar-de-casa/main)
![GitHub contributors](https://img.shields.io/github/contributors/ocodista/trampar-de-casa)
Expand All @@ -20,6 +21,12 @@ Semanalmente, enviamos 1 email com vagas 100% remotas que correspondem ao perfil

## [Manifesto sobre o Trabalho Remoto](./manifesto.md)

## Apoiadores / Sponsors

Um agradecimento especial a todos os nossos [sponsors](https://github.com/sponsors/ocodista) ❤️

<!-- sponsors --><!-- sponsors -->

## Roadmap do Projeto 🚧

- [x] **Cadastro de Preferências**: Definir preferências de trabalho dos usuários.
Expand Down
23 changes: 13 additions & 10 deletions apps/data-lake-seeder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@ const s3Client = new S3Client({
},
})

function generateFileName(): string {
function generateFileName(folder: string): string {
const now = new Date()
const year = now.getFullYear()
const month = String(now.getMonth() + 1).padStart(2, '0')
const day = String(now.getDate()).padStart(2, '0')
const hour = String(now.getHours()).padStart(2, '0')
const minutes = String(now.getMinutes()).padStart(2, '0')

return `roles/${year}${month}${day}_${hour}${minutes}.csv`
return `${folder}/${year}${month}${day}_${hour}${minutes}.csv`
}

async function fetchRolesAndCreateCSV(): Promise<string> {
async function fetchRolesAndCreateCSV(table: string): Promise<string> {
// Fetch data from Supabase
const { data, error } = await supabase.from('Roles').select('*')
const { data, error } = await supabase.from(table).select('*')

if (error) throw error

// Generate CSV content
const csvContent = stringify(data, { header: true })

// Write CSV to a temporary file
const tempFilePath = `/tmp/roles_${Date.now()}.csv`
const tempFilePath = `/tmp/${table.toLowerCase()}_${Date.now()}.csv`
fs.writeFileSync(tempFilePath, csvContent)

return tempFilePath
Expand Down Expand Up @@ -94,16 +94,19 @@ async function uploadFileToS3(filePath: string, fileName: string) {
async function main() {
try {
// Fetch data and create CSV
const csvFilePath = await fetchRolesAndCreateCSV()
const rolesPath = await fetchRolesAndCreateCSV('Roles')
const viewsPath = await fetchRolesAndCreateCSV('Views')

// Generate filename
const fileName = generateFileName()
const roleFileName = generateFileName('roles')
const viewsFileName = generateFileName('views')

// Upload the file to S3
await uploadFileToS3(csvFilePath, fileName)
// Upload to S3
await uploadFileToS3(rolesPath, roleFileName)
await uploadFileToS3(viewsPath, viewsFileName)

// Clean up the temporary file
fs.unlinkSync(csvFilePath)
fs.unlinkSync(rolesPath)
} catch (error) {
console.error('Error:', error.message)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/components/PTBRRolePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const PTBRRolePage = ({ role }) => {
{
icon: <DollarSign className="text-indigo-600" />,
label: 'Salário',
value: role.salary || 'Não informado',
value: role.salary || '',
},
{
icon: <Calendar className="text-indigo-600" />,
Expand Down
3 changes: 2 additions & 1 deletion apps/web/app/components/ui/JobCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useMemo } from 'react'
import { trackedRoleURL } from 'shared/src/services/trackedRoleURL'

const JobCard = ({ job, skillsFromProps }) => {
const normalize = (id: string) => {
Expand All @@ -17,7 +18,7 @@ const JobCard = ({ job, skillsFromProps }) => {

return (
<a
href={job.url}
href={trackedRoleURL(job.id)}
target="_blank"
className="shadow-brand-shadow border-box w-full cursor-pointer rounded-lg border-[1px] bg-[#FCFCFD] p-[30px] hover:border-[1px] hover:border-[#4f46e5] "
rel="noreferrer"
Expand Down
33 changes: 27 additions & 6 deletions apps/web/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use client'

import Image from 'next/image'
import errorImage from 'public/images/errorImage.png'

export default function GlobalError({
reset,
}: {
Expand All @@ -8,12 +11,30 @@ export default function GlobalError({
}) {
return (
<html>
<body>
<h2>Algo deu errado!</h2>
<button onClick={() => reset()}>Tente novamente</button>
<a className="pl-2" href="/">
Volte para a página inicial
</a>
<body className="flex min-h-screen items-center justify-center bg-amber-50 p-4">
<div className="max-w-2xl rounded-lg bg-white p-8 text-center shadow-xl">
<Image
src={errorImage}
alt="Escritório bagunçado com sinais de 'Sem café'"
width={600}
height={600}
className="mb-6 rounded-lg"
/>
<h2 className="text-brown-700 mb-4 text-3xl font-bold">
Oops! Acabou o café!
</h2>
<p className="mb-6 text-lg text-gray-600">
Parece que estamos enfrentando um erro.
</p>
<div className="flex justify-center space-x-4">
<a
href="/"
className="rounded bg-amber-500 px-4 py-2 text-center font-bold text-white transition duration-300 hover:bg-amber-600"
>
Voltar para a Página Inicial
</a>
</div>
</div>
</body>
</html>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "1.0.30",
"version": "1.0.33",
"private": true,
"scripts": {
"dev": "development=true next dev",
Expand Down
Binary file added apps/web/public/images/errorImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ services:
expose:
- 5672
- 15672
redis:
image: redis
container_name: redis
ports:
- '6379:6379'

mongo:
image: mongo:latest
Expand All @@ -31,4 +36,4 @@ services:

volumes:
mongo-data:
driver: local
driver: local
42 changes: 14 additions & 28 deletions packages/shared/ui/email/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
Text,
} from '@react-email/components'
import React from 'react'

export enum HeaderHtmlKeys {
rolesCount = '##ROLES_COUNT',
testimonialLink = '##GET_JOB_TESTIMONIAL',
}

export const HEADER_TITLE_SUFFIX = 'vagas para você Trampar de Casa 🔥'
export const HEADER_TITLE_SUFFIX = 'vagas 100% remotas para você 🏠'

export function Header({
rolesCount,
Expand All @@ -25,14 +26,14 @@ export function Header({
rolesCount: string
testimonialLink: string
}) {
// const previewText = `${rolesCount} ${HEADER_TITLE_SUFFIX}`
const previewText = 'Partiu FrontInSampa!'
const previewText = `${rolesCount} ${HEADER_TITLE_SUFFIX}`
const h1 = 'text-[24px] mt-4'
const hr = {
borderColor: '#e6ebf1',
margin: '20px 0',
}
const paragraph = 'text-[#525f7f] text-[16px] leading-[24px] text-left'

return (
<Tailwind>
<Preview>{previewText}</Preview>
Expand Down Expand Up @@ -68,36 +69,21 @@ export function Header({
<Heading className={h1}>{previewText}</Heading>
<Hr style={hr} />
<Text className={paragraph}>
Salve, amante do trabalho remoto, beleza?
</Text>
<Text className={paragraph}>
Bora colar num dos melhores eventos de programação do país?
</Text>
<Link href="https://fastix.com.br/events/front-in-sampa?coupon=TRAMPARDCASA">
<Img
width={500}
height={250}
src="https://fastix.com.br/_next/image?url=%2Fevents%2Ffront-in-sampa%2Fimage%2Flandscape%3Ft%3D1725461071001&w=3840&q=75"
/>
</Link>
<Text className={paragraph}>
A FrontInSampa, parceira do TramparDeCasa, tá organizando esse evento
magnifíco, que conta com mais de 20 palestras, CodeInTheDark, e{' '}
<strong>muito networking!</strong>
</Text>
<Text className={paragraph}>
Utilizando o cupom <strong>TRAMPARDCASA</strong> você ainda garante{' '}
<strong>15% de desconto</strong> 😁
Salve, amante do trabalho remoto, tudo bem?
</Text>
<Text className={paragraph}>
<Link href="https://fastix.com.br/events/front-in-sampa?coupon=TRAMPARDCASA">
Clique aqui{' '}
</Link>{' '}
e garanta o seu ingresso!
Infelizmente, a Amazon recentemente se juntou ao time de empresas que
são anti trabalho remoto 🤮
</Text>
<Text className={paragraph}>
Agora, aproveite suas vagas desta semana, valeu!
Mas nem tudo está perdido! Por sorte, ainda existem muitas vagas 100%
remotas de empresas que realmente se importam com o equilíbrio entre a
vida e trabalho.
</Text>
<div className="flex">
<Text className={`${paragraph} m-0`}>Aqui vão algumas delas</Text>
<span className="ml-[6px] mt-[8px]">👇</span>😎
</div>
</Tailwind>
)
}
Loading

0 comments on commit 40cfc42

Please sign in to comment.