Adding Stripe onboarding (mostly), changing name and branding to Forum
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Parchment",
|
"name": "Forum",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -39,10 +39,32 @@ class Server {
|
|||||||
router.get('/db/images/*', this.getUserImage)
|
router.get('/db/images/*', this.getUserImage)
|
||||||
router.get('/api/orgdata/*', this.getOrgData)
|
router.get('/api/orgdata/*', this.getOrgData)
|
||||||
router.get('/api/mydata/*', this.getPersonalData)
|
router.get('/api/mydata/*', this.getPersonalData)
|
||||||
|
router.get('/api/stripe/onboarded', this.stripeOnboarded)
|
||||||
router.get('/*', this.get)
|
router.get('/*', this.get)
|
||||||
return router
|
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) => {
|
getPersonalData = async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const memberId = req.params[0]
|
const memberId = req.params[0]
|
||||||
@@ -226,8 +248,8 @@ class Server {
|
|||||||
const app = express();
|
const app = express();
|
||||||
app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook)
|
app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook)
|
||||||
const allowedOrigins = new Set([
|
const allowedOrigins = new Set([
|
||||||
"https://www.parchment.page",
|
"https://www.frm.so",
|
||||||
"https://parchment.page",
|
"https://frm.so",
|
||||||
"http://localhost:5174",
|
"http://localhost:5174",
|
||||||
"http://sam.local:5174",
|
"http://sam.local:5174",
|
||||||
"http://localhost:5173",
|
"http://localhost:5173",
|
||||||
@@ -266,7 +288,7 @@ class Server {
|
|||||||
const PORT = 10002;
|
const PORT = 10002;
|
||||||
server.listen(PORT, () => {
|
server.listen(PORT, () => {
|
||||||
console.log("\n")
|
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.yellowBright(`Server is running on port ${PORT}: http://localhost`));
|
||||||
console.log(chalk.yellow("***************************************"))
|
console.log(chalk.yellow("***************************************"))
|
||||||
console.log("\n")
|
console.log("\n")
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class Forum extends Shadow {
|
|||||||
|
|
||||||
ForumPanel()
|
ForumPanel()
|
||||||
|
|
||||||
input("Message Parchment", "98%")
|
input("Message Forum", "98%")
|
||||||
.paddingVertical(1, em)
|
.paddingVertical(1, em)
|
||||||
.paddingLeft(2, pct)
|
.paddingLeft(2, pct)
|
||||||
.color("var(--accent)")
|
.color("var(--accent)")
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Jobs extends Shadow {
|
|||||||
{
|
{
|
||||||
title: "Austin Chapter Lead",
|
title: "Austin Chapter Lead",
|
||||||
salary: "1% of Local Revenue",
|
salary: "1% of Local Revenue",
|
||||||
company: "Parchment",
|
company: "Forum",
|
||||||
city: "Austin",
|
city: "Austin",
|
||||||
state: "TX"
|
state: "TX"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Market extends Shadow {
|
|||||||
stars: "5",
|
stars: "5",
|
||||||
reviews: 1,
|
reviews: 1,
|
||||||
price: "$12",
|
price: "$12",
|
||||||
company: "Parchment",
|
company: "Forum",
|
||||||
type: "new",
|
type: "new",
|
||||||
image: "/db/images/1",
|
image: "/db/images/1",
|
||||||
madeIn: "America"
|
madeIn: "America"
|
||||||
|
|||||||
@@ -34,8 +34,13 @@ let Global = class {
|
|||||||
const code = params.get("code");
|
const code = params.get("code");
|
||||||
|
|
||||||
if (code) {
|
if (code) {
|
||||||
// send this code to your backend
|
|
||||||
console.log("success!: ", code)
|
console.log("success!: ", code)
|
||||||
|
await fetch("/api/stripe/connect", {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ code })
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Stripe code is not present!")
|
throw new Error("Stripe code is not present!")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Parchment</title>
|
<title>Forum</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" href="/_/icons/quill.svg">
|
<link rel="icon" href="/_/icons/columnred.svg">
|
||||||
<link rel="stylesheet" href="/_/code/shared.css">
|
<link rel="stylesheet" href="/_/code/shared.css">
|
||||||
<script src="/_/code/quill.js"></script>
|
<script src="/_/code/quill.js"></script>
|
||||||
<script src="/_/code/zod.js"></script>
|
<script src="/_/code/zod.js"></script>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="public">
|
<html lang="en" class="public">
|
||||||
<head>
|
<head>
|
||||||
<title>Parchment</title>
|
<title>Forum</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" href="/_/icons/quill.svg">
|
<link rel="icon" href="/_/icons/columnred.svg">
|
||||||
<link rel="stylesheet" href="/_/code/shared.css">
|
<link rel="stylesheet" href="/_/code/shared.css">
|
||||||
<link
|
<link
|
||||||
rel="preload"
|
rel="preload"
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ class Home extends Shadow {
|
|||||||
MainContent() {
|
MainContent() {
|
||||||
return VStack(() => {
|
return VStack(() => {
|
||||||
HStack(() => {
|
HStack(() => {
|
||||||
img("/_/icons/quill.svg", "6vmax")
|
img("/_/icons/columnred.svg", "6vmax")
|
||||||
|
|
||||||
p("PARCHMENT")
|
p("FORUM")
|
||||||
.fontFamily("Nabla")
|
.fontFamily("Nabla")
|
||||||
.fontSize(6, vmax)
|
.fontSize(6, vmax)
|
||||||
.marginLeft(1, rem)
|
.marginLeft(1, rem)
|
||||||
@@ -32,7 +32,7 @@ class Home extends Shadow {
|
|||||||
.verticalAlign("center")
|
.verticalAlign("center")
|
||||||
.horizontalAlign("center")
|
.horizontalAlign("center")
|
||||||
|
|
||||||
p("Parchment is a platform for small to medium-sized communities.")
|
p("Forum is a platform for communities.")
|
||||||
.color("var(--quillred)")
|
.color("var(--quillred)")
|
||||||
.borderTop("1px solid var(--quillred)")
|
.borderTop("1px solid var(--quillred)")
|
||||||
.verticalAlign("center")
|
.verticalAlign("center")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class SignIn extends Shadow {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
ZStack(() => {
|
ZStack(() => {
|
||||||
img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax")
|
img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax")
|
||||||
.position("absolute")
|
.position("absolute")
|
||||||
.top(2, em)
|
.top(2, em)
|
||||||
.left(2, em)
|
.left(2, em)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class SignUp extends Shadow {
|
|||||||
render() {
|
render() {
|
||||||
|
|
||||||
ZStack(() => {
|
ZStack(() => {
|
||||||
img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax")
|
img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax")
|
||||||
.position("absolute")
|
.position("absolute")
|
||||||
.top(2, em)
|
.top(2, em)
|
||||||
.left(2, em)
|
.left(2, em)
|
||||||
@@ -15,8 +15,8 @@ class SignUp extends Shadow {
|
|||||||
h2("$50 / Month Subscription")
|
h2("$50 / Month Subscription")
|
||||||
.color("var(--quillred)")
|
.color("var(--quillred)")
|
||||||
|
|
||||||
p(" - Access to Parchment Online and Parchment Desktop")
|
p(" - Access to Forum Online and Forum Desktop")
|
||||||
p(" - Ability to Create Networks")
|
p(" - Ability to Create Groups")
|
||||||
p(" - Up to 5GB Storage Space")
|
p(" - Up to 5GB Storage Space")
|
||||||
|
|
||||||
button("Buy")
|
button("Buy")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SignupForm extends Shadow {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
ZStack(() => {
|
ZStack(() => {
|
||||||
img("/_/icons/quill.svg", window.isMobile() ? "5vmax" : "3vmax")
|
img("/_/icons/columnred.svg", window.isMobile() ? "5vmax" : "3vmax")
|
||||||
.position("absolute")
|
.position("absolute")
|
||||||
.top(2, em)
|
.top(2, em)
|
||||||
.left(2, em)
|
.left(2, em)
|
||||||
|
|||||||
Reference in New Issue
Block a user