diff --git a/package.json b/package.json index 59175c9..c84e63f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Parchment", + "name": "Forum", "version": "1.0.0", "type": "module", "scripts": { diff --git a/server/index.js b/server/index.js index ad126e7..09e0567 100644 --- a/server/index.js +++ b/server/index.js @@ -39,10 +39,32 @@ class Server { router.get('/db/images/*', this.getUserImage) router.get('/api/orgdata/*', this.getOrgData) router.get('/api/mydata/*', this.getPersonalData) + router.get('/api/stripe/onboarded', this.stripeOnboarded) router.get('/*', this.get) return router } + async stripeOnboarded() { + const { code } = req.body; + + const response = await stripe.oauth.token({ + grant_type: "authorization_code", + code, + }); + + const { stripe_user_id, access_token } = response; + + await db.users.update({ + where: { id: req.user.id }, + data: { + stripeAccountId: stripe_user_id, + stripeAccessToken: access_token, + } + }); + + res.json({ success: true }); + } + getPersonalData = async (req, res, next) => { try { const memberId = req.params[0] @@ -226,8 +248,8 @@ class Server { const app = express(); app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook) const allowedOrigins = new Set([ - "https://www.parchment.page", - "https://parchment.page", + "https://www.frm.so", + "https://frm.so", "http://localhost:5174", "http://sam.local:5174", "http://localhost:5173", @@ -266,7 +288,7 @@ class Server { const PORT = 10002; server.listen(PORT, () => { console.log("\n") - console.log(chalk.yellow("*************** parchment.page ********")) + console.log(chalk.yellow("*************** frm.so ********")) console.log(chalk.yellowBright(`Server is running on port ${PORT}: http://localhost`)); console.log(chalk.yellow("***************************************")) console.log("\n") diff --git a/ui/desktop/apps/Forum/Forum.js b/ui/desktop/apps/Forum/Forum.js index 1e61268..a2087ed 100644 --- a/ui/desktop/apps/Forum/Forum.js +++ b/ui/desktop/apps/Forum/Forum.js @@ -69,7 +69,7 @@ class Forum extends Shadow { ForumPanel() - input("Message Parchment", "98%") + input("Message Forum", "98%") .paddingVertical(1, em) .paddingLeft(2, pct) .color("var(--accent)") diff --git a/ui/desktop/apps/Jobs/Jobs.js b/ui/desktop/apps/Jobs/Jobs.js index 25c6911..5fee1b6 100644 --- a/ui/desktop/apps/Jobs/Jobs.js +++ b/ui/desktop/apps/Jobs/Jobs.js @@ -30,7 +30,7 @@ class Jobs extends Shadow { { title: "Austin Chapter Lead", salary: "1% of Local Revenue", - company: "Parchment", + company: "Forum", city: "Austin", state: "TX" } diff --git a/ui/desktop/apps/Market/Market.js b/ui/desktop/apps/Market/Market.js index 1da5332..9a1785b 100644 --- a/ui/desktop/apps/Market/Market.js +++ b/ui/desktop/apps/Market/Market.js @@ -33,7 +33,7 @@ class Market extends Shadow { stars: "5", reviews: 1, price: "$12", - company: "Parchment", + company: "Forum", type: "new", image: "/db/images/1", madeIn: "America" diff --git a/ui/desktop/index.js b/ui/desktop/index.js index 1fdafb2..bfd74ac 100644 --- a/ui/desktop/index.js +++ b/ui/desktop/index.js @@ -34,8 +34,13 @@ let Global = class { const code = params.get("code"); if (code) { - // send this code to your backend console.log("success!: ", code) + await fetch("/api/stripe/connect", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ code }) + }); + } else { throw new Error("Stripe code is not present!") } diff --git a/ui/mobile/index.html b/ui/mobile/index.html index 7d7cc78..b775c70 100644 --- a/ui/mobile/index.html +++ b/ui/mobile/index.html @@ -1,9 +1,9 @@ - Parchment + Forum - + diff --git a/ui/public/index.html b/ui/public/index.html index f51ed57..c331096 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -1,9 +1,9 @@ - Parchment + Forum - + { HStack(() => { - img("/_/icons/quill.svg", "6vmax") + img("/_/icons/columnred.svg", "6vmax") - p("PARCHMENT") + p("FORUM") .fontFamily("Nabla") .fontSize(6, vmax) .marginLeft(1, rem) @@ -32,7 +32,7 @@ class Home extends Shadow { .verticalAlign("center") .horizontalAlign("center") - p("Parchment is a platform for small to medium-sized communities.") + p("Forum is a platform for communities.") .color("var(--quillred)") .borderTop("1px solid var(--quillred)") .verticalAlign("center") diff --git a/ui/public/pages/SignIn.js b/ui/public/pages/SignIn.js index f45a3b9..f171cc4 100644 --- a/ui/public/pages/SignIn.js +++ b/ui/public/pages/SignIn.js @@ -8,7 +8,7 @@ class SignIn extends Shadow { render() { ZStack(() => { - img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax") + img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax") .position("absolute") .top(2, em) .left(2, em) diff --git a/ui/public/pages/SignUp.js b/ui/public/pages/SignUp.js index 54291dd..2cab0b7 100644 --- a/ui/public/pages/SignUp.js +++ b/ui/public/pages/SignUp.js @@ -2,7 +2,7 @@ class SignUp extends Shadow { render() { ZStack(() => { - img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax") + img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax") .position("absolute") .top(2, em) .left(2, em) @@ -15,8 +15,8 @@ class SignUp extends Shadow { h2("$50 / Month Subscription") .color("var(--quillred)") - p(" - Access to Parchment Online and Parchment Desktop") - p(" - Ability to Create Networks") + p(" - Access to Forum Online and Forum Desktop") + p(" - Ability to Create Groups") p(" - Up to 5GB Storage Space") button("Buy") diff --git a/ui/public/pages/SignupForm.js b/ui/public/pages/SignupForm.js index ef1643a..0f8441e 100644 --- a/ui/public/pages/SignupForm.js +++ b/ui/public/pages/SignupForm.js @@ -11,7 +11,7 @@ class SignupForm extends Shadow { render() { ZStack(() => { - img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax") + img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax") .position("absolute") .top(2, em) .left(2, em)