Skip to content

Commit

Permalink
feat: map nostr public key to DNS joyboy.community using NIP-05 (#95)
Browse files Browse the repository at this point in the history
* feat: migrate from react to nextjs

* feat: map nostr public key to DNS joyboy.community using NIP-05

* chore: modify ```nostr.json``` path

* fix: fix imports and dependencies

---------

Co-authored-by: Gift-Naomi <emmanuelgiftee@gmail.com>
Co-authored-by: EjembiEmmanuel <ejembioche50@gmail.com>
Co-authored-by: Maciej Kamiński @ StarkWare <aundumla@gmail.com>
  • Loading branch information
4 people authored Jun 13, 2024
1 parent 6e11aad commit 9fff77f
Show file tree
Hide file tree
Showing 62 changed files with 2,336 additions and 17,752 deletions.
3 changes: 3 additions & 0 deletions website/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
4 changes: 4 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# next
.next
next-env.d.ts
4 changes: 4 additions & 0 deletions website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
19,359 changes: 1,946 additions & 17,413 deletions website/package-lock.json

Large diffs are not rendered by default.

50 changes: 14 additions & 36 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,28 @@
"name": "website",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "next start",
"build": "next build"
},
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"framer-motion": "^11.2.4",
"next": "^14.2.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^16.18.96",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^9.3.0",
"framer-motion": "^11.2.4",
"postcss": "^8.4.38",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.1.0",
"react-scripts": "5.0.1",
"tailwindcss": "^3.4.3",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-helmet": "^6.1.11",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
29 changes: 0 additions & 29 deletions website/src/App.tsx

This file was deleted.

31 changes: 31 additions & 0 deletions website/src/app/.well-known/nostr.json/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NextResponse, NextRequest } from 'next/server';

const nostr_keys = {
joyboy: {
pubkey: 'npub1nq5ckz62p4vxwu08lpx8ggu5k5qn6d7pdtcfyj7hae3wc6j30fwseex2rq',
},
testnet: {
pubkey: 'b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9'
}
};

export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const name = searchParams.get('name');

if (!name || !nostr_keys[name]) {
return NextResponse.json({ error: 'User not found' }, { status: 404 });
}

const nostr_key = nostr_keys[name];
const response = {
names: {
[name]: nostr_key.pubkey
},
};

const nextResponse = NextResponse.json(response);
nextResponse.headers.set('Access-Control-Allow-Origin', '*');

return nextResponse;
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import { motion } from "framer-motion";
const About: React.FC = () => {

export function About() {
return (
<div className="bg-black py-[40px] tab:py-[140px] text-center text-white text-base tab:text-[32px] leading-[32px] desktop:leading-[50px] font-normal z-[50] relative px-6 desktop:px-[171px]">
<motion.p
Expand All @@ -18,5 +21,3 @@ const About: React.FC = () => {
</div>
);
};

export default About;
187 changes: 187 additions & 0 deletions website/src/app/components/AboutUs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import { motion } from "framer-motion";
import { Navbar } from "./Navbar";
import { Footer } from "./Footer";

const AboutUs: React.FC = () => {
return (
<div className="bg-black text-white">
<Navbar />
<div className="desktop:h-[900px] h-[833px] w-full overflow-hidden relative pt-[98px] desktop:pt-[159px] flex justify-center bg-black desktop:bg-herobg bg-mobileHeroBg bg-no-repeat bg-bottom">
<motion.img
animate={{ x: [500, 0] }}
transition={{
x: { duration: 1 }
}}
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
src="/assets/moon.svg"
className="absolute top-5 desktop:top-[36px] right-[31px] desktop:right-[150px] w-[50px] desktop:w-auto"
alt=""
/>
<motion.div
animate={{ y: [1200, 0] }}
transition={{
y: { duration: 1 }
}}
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
className="desktop:w-[50%] w-[100%] flex flex-col items-center text-white h-fit relative z-[270] ml-auto px-24"
>
<h1 className="desktop:text-5xl text-[36px] desktop:leading-[70px] mb-3 justify-self-end">
Building for the Community, by the Community
</h1>
<p className="desktop:text-[16px] text-base leading-8 mb-8">
Welcome to Joyboy, a decentralized social media platform where your
voice matters. Entirely open-sourced and community-managed, Joyboy
empowers you to shape your social media experience
</p>
</motion.div>
<motion.img
src="/assets/joyboyMascot.png"
className="absolute left-[292px] desktop:left-492 bottom-[10px] desktop:bottom-[200px] z-[250] desktop:w-[380px] w-[210px]"
alt=""
animate={{ x: [-500, 0] }}
transition={{
x: { duration: 1 }
}}
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
/>
</div>
<div className="mx-24 mt-12">
<div className="mt-12 p-8">
<h1 className="text-5xl text-center">About Us</h1>
<p className="p-5 tracking-wide leading-loose">
Welcome to Joyboy, the decentralized social media platform built
with Nostr and powered by Starknet account abstraction. Joyboy aims
to revolutionize social networking by blending SocialFi (social
finance) with cutting-edge blockchain technology, bridging the gap
between Web2 networks and decentralized finance (DeFi). This
integration allows users to earn rewards for their engagement while
maintaining control over their data and freedom of expression.
</p>
</div>
<div className="mt-12 p-8">
<h1 className="text-5xl p-5">Why Nostr</h1>
<p className="p-5 tracking-wide leading-loose">
Nostr, short for "Notes and Other Stuff Transmitted by Relays," is a
simple yet powerful protocol enabling secure and
censorship-resistant communication. Here's a brief guide to
understanding Nostr:
<ol className="list-decimal p-4">
<li>
Decentralized Network: No central authority controls Nostr,
ensuring true decentralization.
</li>
<li>
Pseudonymous Accounts: No need for an email or phone number to
create an account.
</li>
<li>
Monetization: Creators can earn tips directly from their
content.
</li>
<li>
Open Source: Anyone can contribute to the development of Nostr.
</li>
</ol>
</p>
</div>
<div className="mt-12 p-8">
<h1 className="text-5xl p-5">How does Nostr work ?</h1>
<p className="p-5 tracking-wide leading-loose">
Nostr operates by allowing users to publish and query notes through
independent servers (relays), eliminating single points of failure
and enhancing both privacy and reliability. This decentralized
approach addresses the censorship issues faced by traditional social
media platforms, offering a haven for controversial speech without
the risk of deplatforming. Nostr's innovative approach to identity
and user experience allows individuals to view feeds from any public
key, offering diverse perspectives and a unique glimpse into other
users' thoughts and
</p>
</div>
<div className="mt-12 p-24 border border-blue-400 rounded-3xl bg-blue-600 bg-opacity-10 backdrop-filter backdrop-blur-lg text-white">
<h1 className="text-5xl text-center font-bold text-blue-500">
What is Joyboy?
</h1>
<p className="p-5 tracking-wide leading-loose">
Joyboy is a decentralized SocialFi platform that combines the Nostr
protocol with Starknet's native account abstraction. Nostr, often
referred to as the "Farcaster" of Bitcoin, emphasizes censorship
resistance and is minimalistic and pure in design. Utilizing Bitcoin
cryptographic primitives such as Schnorr signatures and concepts
like NIP-13 Proof of Work as an anti-spam mechanism, Nostr is
integrated into various Lightning wallets like @getAlby, Wallet of
Satoshi and Blue wallet Leveraging the power of Starknet's Account
Abstraction, Joyboy enables users to control their Starknet accounts
with their Nostr keypair. This integration allows us to build
advanced features like fully trustless Social Pay and intent-based
actions driven by messages on the social app. We can even explore
Al-driven intent-based systems with trustless on-chain verification
using ZKML provided by Giza Tech and Herodotus
</p>
</div>
<div className="mt-12 p-8">
<h1 className="text-5xl px-5">Understanding SocialFi</h1>
<p className="p-5 tracking-wide leading-loose">
SocialFi is the fusion of social media and decentralized finance,
empowering users
<ol className="list-disc p-4">
<li>
Data Control: Users have complete ownership of their data.
</li>
<li>
Freedom of Expression: Censorship resistance ensures free
speech.
</li>
<li>
Earning Opportunities: Users can earn rewards for their
engagement through various monetization strategies.
</li>
</ol>
</p>
</div>
<div className="mt-2 px-8">
<h1 className="text-5xl px-5">Key Elements Include</h1>
<p className="p-5 tracking-wide leading-loose">
<ol className="list-disc p-4">
<li>
Digital Ownership with NFTs: Non-fungible tokens (NFTs) ensure
secure and verifiable digital ownership.
</li>
<li>
Decentralized Governance with DAOs: Decentralized autonomous
organizations (DAOs) facilitate community-driven
decision-making.
</li>
</ol>
</p>
</div>
<div className="mt-2 px-8">
<h1 className="text-5xl px-5">Building Blocks of SocialFi</h1>
<p className="p-5 tracking-wide leading-loose">
SocialFi relies on several core components:
<ol className="list-disc p-4">
<li>
Monetization through Social Tokens: Creators can earn directly
from their content.
</li>
<li>
Censorship Resistance: Decentralized curation ensures freedom of
speech.
</li>
<li>
Digital Ownership: NFTs provide secure ownership of digital
assets.
</li>
</ol>
</p>
</div>
</div>
<Footer />
</div>
);
};

export default AboutUs;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import githubLogo from "../assets/githubLogo.svg";
import githubLogoDark from "../assets/githubLogoDark.svg";
import gotTo from "../assets/go-to.svg";
"use client";

import { motion } from "framer-motion";
const ContributeSection: React.FC = () => {

export function ContributeSection() {
return (
<div className="desktop:pt-[84px] pt-[40px] pb-[50px] desktop:pb-[180px] bg-contributeBg bg-contain tab:bg-cover bg-center bg-no-repeat text-white h-auto desktop:h-[654px]">
<motion.div
Expand All @@ -15,7 +15,7 @@ const ContributeSection: React.FC = () => {
className="flex flex-col items-center"
>
<img
src={githubLogo}
src="/assets/githubLogo.svg"
className="mb-4 desktop:h-[150px] desktop:w-[150px] h-[80px] w-[80px]"
alt=""
/>
Expand All @@ -26,13 +26,11 @@ const ContributeSection: React.FC = () => {
Joyboy is available on iOS and Android. It's free and open source.
</p>
<button className="py-[15px] desktop:px-[42px] px-[24px] bg-white rounded-[5px] flex gap-x-[10px] items-center text-black">
<img src={githubLogoDark} alt="" />
<img src="/assets/githubLogoDark.svg" alt="" />
See all issues on Github
<img src={gotTo} alt="" />
<img src="/assets/go-to.svg" alt="" />
</button>
</motion.div>
</div>
);
};

export default ContributeSection;
Loading

0 comments on commit 9fff77f

Please sign in to comment.