Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ yarn-error.log*

# typescript
*.tsbuildinfo

secrets/
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
137 changes: 0 additions & 137 deletions bk.sql

This file was deleted.

5 changes: 2 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ const config = {
reactStrictMode: true,
swcMinify: true,
output: "standalone",
i18n: {
locales: ["it"],
defaultLocale: "it",
experimental: {
appDir: true,
},
};

Expand Down
1,712 changes: 1,044 additions & 668 deletions package-lock.json

Large diffs are not rendered by default.

72 changes: 37 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,71 @@
"@editorjs/checklist": "^1.4.0",
"@editorjs/code": "^2.8.0",
"@editorjs/delimiter": "^1.3.0",
"@editorjs/editorjs": "^2.26.3",
"@editorjs/editorjs": "^2.26.5",
"@editorjs/embed": "^2.5.3",
"@editorjs/header": "^2.7.0",
"@editorjs/image": "^2.7.1",
"@editorjs/image": "^2.8.1",
"@editorjs/inline-code": "^1.4.0",
"@editorjs/list": "^1.8.0",
"@editorjs/marker": "^1.3.0",
"@editorjs/paragraph": "^2.9.0",
"@editorjs/quote": "^2.5.0",
"@editorjs/table": "^2.1.2",
"@editorjs/table": "^2.2.0",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@google-cloud/storage": "^6.8.0",
"@headlessui/react": "^1.7.5",
"@heroicons/react": "^2.0.13",
"@google-cloud/storage": "^6.9.1",
"@headlessui/react": "^1.7.12",
"@heroicons/react": "^2.0.14",
"@next-auth/prisma-adapter": "^1.0.5",
"@prisma/client": "^4.9.0",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.8",
"@tanstack/react-query": "^4.16.0",
"@trpc/client": "^10.0.0",
"@trpc/next": "^10.0.0",
"@trpc/react-query": "^10.0.0",
"@trpc/server": "^10.0.0",
"axios": "^1.2.1",
"cloudinary": "^1.32.0",
"@tailwindcss/typography": "^0.5.9",
"@tanstack/react-query": "^4.24.4",
"@trpc/client": "^10.9.1",
"@trpc/next": "^10.9.1",
"@trpc/react-query": "^10.9.1",
"@trpc/server": "^10.9.1",
"axios": "^1.3.1",
"cloudinary": "^1.33.0",
"clsx": "^1.2.1",
"cuid": "^2.1.8",
"daisyui": "^2.43.1",
"daisyui": "^2.50.0",
"fast-deep-equal": "^3.1.3",
"final-form": "^4.20.7",
"final-form-arrays": "^3.0.2",
"final-form": "^4.20.9",
"final-form-arrays": "^3.1.0",
"kannon.js": "^0.3.0",
"next": "13.0.2",
"next-auth": "^4.18.3",
"next-mdx-remote": "^4.2.0",
"next": "13.1.6",
"next-auth": "^4.19.2",
"next-mdx-remote": "^4.3.0",
"next-superjson": "^0.0.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-editor-js": "^2.1.0",
"react-final-form": "^6.5.9",
"react-final-form-arrays": "^3.1.4",
"superjson": "1.9.1",
"react-toastify": "^9.1.1",
"superjson": "1.12.2",
"telegraf": "^4.11.2",
"zod": "^3.18.0"
"zod": "^3.20.2",
"zustand": "^4.3.2"
},
"devDependencies": {
"@types/editorjs__header": "^2.6.0",
"@types/node": "^18.0.0",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"autoprefixer": "^10.4.7",
"eslint": "^8.26.0",
"eslint-config-next": "13.0.2",
"@types/node": "^18.11.18",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.33.0",
"eslint-config-next": "13.1.6",
"node-html-parser": "^6.1.4",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"postcss": "^8.4.21",
"prettier": "^2.8.3",
"prettier-plugin-tailwindcss": "^0.2.2",
"prisma": "^4.9.0",
"tailwindcss": "^3.2.0",
"typescript": "^4.8.4"
"tailwindcss": "^3.2.4",
"typescript": "^4.9.5"
},
"ct3aMetadata": {
"initVersion": "6.11.3"
Expand Down
123 changes: 123 additions & 0 deletions scripts/tk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import { KannonCli } from "kannon.js";

const emails = [
"silvia@farmaceuticayounger.science",
"ludovico@ludusrusso.space",
"simonecossari@gmail.com",
"francesca.lovisari90@gmail.com",
"francesco.rizzuto@studenti.unimi.it",
"camilla.vitagliano@studenti.unimi.it",
"irene.carnovale@gmail.com",
"veronica.moscatelli90@gmail.com",
"catalanstefania@gmail.com",
"robertacocomazzi@gmail.com",
"ginevravigni@gmail.com",
"alessandro.buoso1@gmail.com",
"dottannateresa.greco@gmail.com",
"giovanna.lamonica86@gmail.com",
"v.giacchetti@libero.it",
"manuel.grotti@gmail.com",
"alberti.giovanbattista@gmail.com",
"mariantoniettatat@gmail.com",
"vittoria.reggiani@tiscali.it",
"torricarlo79@gmail.com",
"elenaelli77@gmail.com",
"monica.rossetti83@gmail.com",
"robe.fumarola.rf@gmail.com",
"veronica.nicosia.vn@gmail.com",
"antonietta.puricella@gmail.com",
"virginiavittorio@libero.it",
"ddesantis4@gmail.com",
"arianna.cislaghi94@gmail.com",
"fenice_sigma_q@yahoo.it",
"alessandro.giraudo.ag@gmail.com",
"capuano93@gmail.com",
"fmattiotti@gmail.com",
"walter.fazzini92@gmail.com",
"simona.pasqualino92@gmail.com",
"chiarabongio89@gmail.com",
"emanuelasalicchi@libero.it",
"chiara071993@hotmail.it",
"maruocco.1@gmail.com",
"lapeccerella.silvia@gmail.com",
"roberto.perna94@gmail.com",
"m.mosca91@hotmail.it",
"cfrancioso22@gmail.com",
"avolioemanuela@outlook.com",
"giulia.gasparri96@gmail.com",
"jacopo.busetto@gmail.com",
"marziale.comito@acsdobfar.it",
"emanuele.bertea@gmail.com",
"aurora.brandino@gmail.com",
"gaetano.lopopolo@gmail.com",
"p.pavoni96@gmail.com",
"davide.costanza@outlook.it",
"peppesem92@gmail.com",
"ingargiolamarianna@gmail.com",
"degiorgitiziano@libero.it",
"mirko.friscia@yahoo.com",
"matteo.casalotti@gmail.com",
"rlanzani@progefarm.it",
"margherita.restori@outlook.com",
"vivianariccardi@libero.it",
"mtt.federici@gmail.com",
"mattiarossi510@gmail.com",
"emanueleconforti96@gmail.com",
"simone.baiano89@gmail.com",
"nicolebuono00@gmail.com",
"luanadannunzio90@gmail.com",
"denisianak@libero.it",
"giostrachiara@gmail.com",
"adm.desantis@gmail.com",
"martino.spighi@gmail.com",
"antonio.arigliani@italianmr.com",
"ilarialupoi@gmail.com",
];

const html = `<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><title>Quota associativa 2023!</title><!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]--><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style type="text/css">#outlook a { padding:0; }
body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }
table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }
img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }
p { display:block;margin:13px 0; }</style><!--[if mso]>
<noscript>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
</noscript>
<![endif]--><!--[if lte mso 11]>
<style type="text/css">
.mj-outlook-group-fix { width:100% !important; }
</style>
<![endif]--><style type="text/css">@media only screen and (min-width:480px) {
.mj-column-px-100 { width:100px !important; max-width: 100px; }
.mj-column-per-100 { width:100% !important; max-width: 100%; }
}</style><style media="screen and (min-width:480px)">.moz-text-html .mj-column-px-100 { width:100px !important; max-width: 100px; }
.moz-text-html .mj-column-per-100 { width:100% !important; max-width: 100%; }</style><style type="text/css">@media only screen and (max-width:480px) {
table.mj-full-width-mobile { width: 100% !important; }
td.mj-full-width-mobile { width: auto !important; }
}</style></head><body style="word-spacing:normal;background-color:#E7E7E7;"><div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">Rinnova la tua quota Associativa!</div><div style="background-color:#E7E7E7;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#f472b6;background-color:#f472b6;width:100%;"><tbody><tr><td><!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" bgcolor="#f472b6" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--><div style="margin:0px auto;max-width:600px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"><!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:100px;" ><![endif]--><div class="mj-column-px-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tbody><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;"><tbody><tr><td style="width:50px;"><img alt height="auto" src="https://res.cloudinary.com/dbdvy5b2z/image/upload/w_100/v1661609934/fy/logos/fy-white_khjfr9.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="50"></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table><!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="body-section-outlook" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--><div class="body-section" style="-webkit-box-shadow: 1px 4px 11px 0px rgba(0, 0, 0, 0.15); -moz-box-shadow: 1px 4px 11px 0px rgba(0, 0, 0, 0.15); box-shadow: 1px 4px
11px 0px rgba(0, 0, 0, 0.15); margin: 0px auto; max-width: 600px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0px;padding-top:0;text-align:center;"><!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" width="600px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--><div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;padding-left:15px;padding-right:15px;text-align:center;"><!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:570px;" ><![endif]--><div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"><tbody><tr><td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:16px;font-weight:400;line-height:24px;text-align:left;color:#637381;"><p>Ciao Socio/a,</p><p>spero che ti sia divertito insieme a tutti noi di Farmaceutica Younger in questo anno appena passato!</p><p>Abbiamo imparato a conoscerci sui social 💬 e ad approfondire il nostro legame 🔗 dal vivo. Perchè questo è uno degli scopi dell'Associazione, quello di <strong>unire i futuri professionisti del farmaceutico</strong>.</p><p>Questo 2023 abbiamo tante idee e iniziative che vorremmo portare avanti con il tuo aiuto! Non solo eventi open ma il <strong>2023 sarà ricco di eventi formativi riservati esclusivamente ai soci di FY</strong>.</p><p>Se vuoi far parte anche quest'anno dell'Associazione <strong>rinnova la tua iscrizione per l'anno 2023</strong>.</p><p><strong>🤑 La quota fissata per l'anno 2023 è di 20€</strong>!</p><p></p><p>Da quest'anno abbiamo creato all'interno del sito di Farmaceutica Younger una pagina dedicata ai soci, da cui potrai vedere il tuo stato di socio e rinnovare comodamente l'iscrizione o iscriverti se non hai mai effettuato l'accesso. Ti basterà cliccare sul link in basso 👇</p><p><a href="https://www.farmaceuticayounger.science/dashboard/association/register">👨‍💻 Accedi al tuo Profilo di Farmaceutica Younger!</a></p><p><em>Se ti starai chiedendo ma dove finiscono i miei soldi?</em> Per finanziare il mercato nero del farmaco o per pagare l'abbonamento a Disney+ del Direttivo ... anche se ci piacerebbe! La risposta è no, almeno quella ufficiale!</p><p>Serviranno per portare avanti le attività dell'Associazione che vogliamo condividere quest’anno più che mai con te!</p><p><strong>Ricordati che hai tempo fino al 28 Febbraio 2023 per rinnovare la tua quota, altrimenti il tua iscrizione come socio all'assocazione decadrà automaticamente.</strong></p><p>A prestissimoooo 🍾 per un anno ricco di spumeggianti eventi!</p><p>Silvia di <strong>FY</strong></p></div></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td><!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--><div style="margin:0px auto;max-width:600px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"><!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" width="600px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--><div style="margin:0px auto;max-width:600px;"><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"><tbody><tr><td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"><!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]--><div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"><tbody><tr><td style="vertical-align:top;padding:0px;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"><tbody><tr><td align="center" style="font-size:0px;padding:0px;word-break:break-word;"><!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" ><tr><td><![endif]--><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;"><tr><td style="padding:4px;vertical-align:middle;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#0077b5;border-radius:3px;width:30px;"><tr><td style="font-size:0;height:30px;vertical-align:middle;width:30px;"><a href="https://www.linkedin.com/shareArticle?mini=true&url=https://www.linkedin.com/company/farmaceutica-younger/&title=&summary=&source=" target="_blank"><img height="30" src="https://www.mailjet.com/images/theme/v1/icons/ico-social/linkedin.png" style="border-radius:3px;display:block;" width="30"></a></td></tr></table></td></tr></table><!--[if mso | IE]></td></tr></table><![endif]--></td></tr><tr><td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;font-weight:400;line-height:16px;text-align:center;color:#445566;">&copy; Farmaceutica Younger, All Rights Reserved.</div></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div></body></html>`;

async function main() {
const kannon = new KannonCli(
"k.farmaceuticayounger.science",
"rqHwy75pvEvBSvfYtRZslLvFzHZNuk",
{
alias: "Silvia di Farmaceutica Younger",
email: "silvia@farmaceuticayounger.science",
},
{
host: "grpc.kannon.email:443",
}
);
return await kannon.sendHtml(
emails.map((email) => ({ email, fields: {} })),
"Quota associativa 2023 💰+💊=❤️ Farmaceutica Younger",
html
);
}

main().then((res) => console.log(res));
21 changes: 21 additions & 0 deletions src/app/dashboard/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use client";

import { useSession } from "next-auth/react";
import { useRouter } from "next/navigation";
import { useEffect } from "react";

const Layout = ({ children }: { children: React.ReactNode }) => {
const { data } = useSession();
const router = useRouter();
const user = data?.user;
useEffect(() => {
if (!user?.isAdmin) {
router.push("/dashboard");
}
}, [user?.isAdmin, router]);

if (!user?.isAdmin) return <div>Loading...</div>;
return children;
};

export default Layout;
Loading