diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml
index c43c056..8222c4b 100644
--- a/.forgejo/workflows/deploy.yml
+++ b/.forgejo/workflows/deploy.yml
@@ -20,8 +20,17 @@ jobs:
chmod 600 ./deploy.key
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
+ - name: Create env file
+ run: |
+ touch .env
+ echo EMAIL_ACCESS_KEY=${{ secrets.EMAIL_ACCESS_KEY }} >> .env
+ echo EMAIL_BASE_URL=${{ secrets.EMAIL_BASE_URL }} >> .env
+
+ - name: Verify .env file creation
+ run: cat .env
+
- name: Install PM2
run: npm i -g pm2
- name: Deploy
- run: pm2 deploy ecosystem.config.cjs production
+ run: env $(cat .env | grep -v \"#\" | xargs) pm2 deploy ecosystem.config.cjs production
diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs
index 8d05d01..eb6b782 100644
--- a/ecosystem.config.cjs
+++ b/ecosystem.config.cjs
@@ -10,6 +10,8 @@ module.exports = {
watch: false,
max_memory_restart: '1G',
env: {
+ EMAIL_ACCESS_KEY: process.env.EMAIL_ACCESS_KEY,
+ EMAIL_BASE_URL: process.env.EMAIL_BASE_URL,
NODE_ENV: 'production',
PORT: 7281,
},
@@ -27,6 +29,8 @@ module.exports = {
'post-deploy':
'npm run build && pm2 reload ecosystem.config.cjs --only embroidery-viewer-prod --env production && pm2 save',
env: {
+ EMAIL_ACCESS_KEY: process.env.EMAIL_ACCESS_KEY,
+ EMAIL_BASE_URL: process.env.EMAIL_BASE_URL,
PORT: 7281,
NODE_ENV: 'production',
},
diff --git a/src/lib/assets/app-with-frame.png b/src/lib/assets/app-with-frame.png
new file mode 100644
index 0000000..5fbc22a
Binary files /dev/null and b/src/lib/assets/app-with-frame.png differ
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 38404ed..d079386 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -28,7 +28,7 @@
diff --git a/src/routes/+page.js b/src/routes/+page.js
index b0adabb..6f0c725 100644
--- a/src/routes/+page.js
+++ b/src/routes/+page.js
@@ -1,3 +1,4 @@
+
/** @type {import('./$types').PageLoad} */
export function load() {
return {
diff --git a/src/routes/+page.server.js b/src/routes/+page.server.js
new file mode 100644
index 0000000..da0676f
--- /dev/null
+++ b/src/routes/+page.server.js
@@ -0,0 +1,33 @@
+import { EMAIL_ACCESS_KEY, EMAIL_BASE_URL } from '$env/static/private';
+
+/** @type {import('./$types').Actions} */
+export const actions = {
+ default: async ({ request }) => {
+ const formData = await request.formData();
+ console.log(formData);
+
+ const response = await fetch(`${EMAIL_BASE_URL}/submit`, {
+ method: 'POST',
+ body: JSON.stringify({
+ accessKey: EMAIL_ACCESS_KEY,
+ subject: 'Contato - Embroidery Viewer Beta Testers!',
+ name: formData.get('name'),
+ email: formData.get('email'),
+ }),
+ headers: { 'Content-Type': 'application/json' }
+ });
+
+ const json = await response.json();
+ if (json.error === undefined) {
+ return {
+ message: 'Name and email sent successfully! We\'ll contact you soon!',
+ textColor: 'green'
+ };
+ } else {
+ return {
+ message: 'Something went wrong!',
+ textColor: 'red'
+ };
+ }
+ }
+};
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 15ce0fd..78ad512 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,15 +1,85 @@
+ Weβre launching the Embroidery Viewer Android App β and you can be one of the first to try it! +
++ Enjoy a smooth, ad-free experience to visualize PES, JEF, PEC, and VP3 embroidery files right from your phone. + Help us improve it and get early access before everyone else. +
+ + + +