Skip to content

Commit

Permalink
Feat: Add Push and Moralis integrations (#12)
Browse files Browse the repository at this point in the history
* feat: add push integration

* feat: add moralis integration

* chore: bump package version to 0.4.0
  • Loading branch information
marthendalnunes authored Aug 17, 2023
1 parent e55fa0f commit 7464cd1
Show file tree
Hide file tree
Showing 72 changed files with 6,972 additions and 4,271 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-turbo-eth",
"version": "0.3.0",
"version": "0.4.0",
"description": "Create web3 apps in turbo mode.",
"author": "Vitor @marthendalnunes",
"license": "MIT",
Expand Down
45 changes: 44 additions & 1 deletion src/config/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const integrationOptions: Integrations = {
env: {
NEXT_PUBLIC_LIVEPEER_API_KEY: {
message: 'What is your Livepeer API Key?',
instructions: 'You can get your OpenAI API Key at https://livepeer.studio/',
instructions: 'You can get your Livepeer API Key at https://livepeer.studio/',
validate: (input: string) => {
if (z.string().min(1).safeParse(input).success) {
return true
Expand All @@ -244,6 +244,49 @@ export const integrationOptions: Integrations = {
},
],
},
'push-protocol': {
name: 'Push Protocol',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*push_protocol: \{\s*name: 'Push Protocol',[\s\S]*?imgDark: '\/integrations\/push.svg',\s*\},/g],
},
{
dependencyPath: indexPagePath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.push_protocol\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
],
},
moralis: {
name: 'Moralis',
pageDependencies: [
{
dependencyPath: dataConfigPath,
type: 'snippet',
regexList: [/\n\s*moralis: \{\s*name: 'Moralis',[\s\S]*?imgDark: '\/integrations\/moralis.png',\s*\},/g],
},
{
dependencyPath: indexPagePath,
type: 'snippet',
regexList: [/\n\s*{\s*title: turboIntegrations\.moralis\.name,[\s\S]*?<\/IsDarkTheme>\s*<\/div>\s*\),\s*},/g],
},
],
env: {
MORALIS_API_KEY: {
message: 'What is your Moralis API Key?',
instructions: 'You can get your Moralis API Key at https://admin.moralis.io/register',
validate: (input: string) => {
if (z.string().min(1).safeParse(input).success) {
return true
}

return 'Moralis API Key is required'
},
},
},
},
starter: {
name: 'Starter',
pageDependencies: [
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export type AvailableIntegrations =
| 'connext'
| 'livepeer'
| 'gelato'
| 'push-protocol'
| 'moralis'
| 'starter'

export type Integrations = Record<AvailableIntegrations, Integration>
Expand Down
3 changes: 3 additions & 0 deletions template/base/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ ETHERSCAN_API_KEY_POLYGON=

# OpenAI API Key: https://platform.openai.com/account/api-keys
OPENAI_API_KEY=

# Moralis API Key: https://admin.moralis.io/settings#secret-keys
MORALIS_API_KEY=
30 changes: 30 additions & 0 deletions template/base/app/(general)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,36 @@ const features = [
</div>
),
},
{
title: turboIntegrations.push_protocol.name,
description: turboIntegrations.push_protocol.description,
href: turboIntegrations.push_protocol.href,
demo: (
<div className="flex items-center justify-center space-x-20">
<IsLightTheme>
<Image alt="Push Protocol logo" height={100} src={turboIntegrations.push_protocol.imgDark} width={100} />
</IsLightTheme>
<IsDarkTheme>
<Image alt="Push Protocol logo" height={100} src={turboIntegrations.push_protocol.imgLight} width={100} />
</IsDarkTheme>
</div>
),
},
{
title: turboIntegrations.moralis.name,
description: turboIntegrations.moralis.description,
href: turboIntegrations.moralis.href,
demo: (
<div className="flex items-center justify-center space-x-20">
<IsLightTheme>
<Image alt="Moralis logo" height={100} src={turboIntegrations.moralis.imgDark} width={100} />
</IsLightTheme>
<IsDarkTheme>
<Image alt="Mtarter logo" height={100} src={turboIntegrations.moralis.imgLight} width={100} />
</IsDarkTheme>
</div>
),
},
{
title: turboIntegrations.starter.name,
description: turboIntegrations.starter.description,
Expand Down
18 changes: 17 additions & 1 deletion template/base/data/turbo-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const turboIntegrations = {
sessionKeys: {
name: 'Session Keys',
href: '/integration/session-keys',
// TODO: Update url to the session keys section of Turbo ETH docs once it's finished
url: 'https://viem.sh/',
description: 'Short-lived private keys enable transaction signing and the granting of temporary smart contract permissions.',
imgLight: '/integrations/session-keys.png',
Expand Down Expand Up @@ -88,6 +87,7 @@ export const turboIntegrations = {
imgLight: '/integrations/connext.png',
imgDark: '/integrations/connext.png',
},

gelato: {
name: 'Gelato',
href: '/integration/gelato',
Expand All @@ -96,6 +96,22 @@ export const turboIntegrations = {
imgLight: '/integrations/gelato-light.svg',
imgDark: '/integrations/gelato-light.svg',
},
push_protocol: {
name: 'Push Protocol',
href: '/integration/push-protocol',
url: 'https://push.org/',
description: 'Push Protocol is a web3 communication network, enabling cross-chain notifications and messaging for dapps, wallets, and services.',
imgLight: '/integrations/push.svg',
imgDark: '/integrations/push.svg',
},
moralis: {
name: 'Moralis',
href: '/integration/moralis',
url: 'https://docs.moralis.io/',
description: 'Moralis provides a complete end-to-end blockchain application development platform.',
imgLight: '/integrations/moralis.png',
imgDark: '/integrations/moralis.png',
},
starter: {
name: 'Starter Template',
href: '/integration/starter',
Expand Down
2 changes: 2 additions & 0 deletions template/base/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const env = createEnv({
ETHERSCAN_API_KEY_OPTIMISM: z.string().min(1).optional(),
ETHERSCAN_API_KEY_ARBITRUM: z.string().min(1).optional(),
ETHERSCAN_API_KEY_POLYGON: z.string().min(1).optional(),
MORALIS_API_KEY: z.string().min(1).optional(),
},
client: {
NEXT_PUBLIC_USE_PUBLIC_PROVIDER: z.enum(['true', 'false']).default('true'),
Expand All @@ -37,6 +38,7 @@ export const env = createEnv({
ETHERSCAN_API_KEY_OPTIMISM: process.env.ETHERSCAN_API_KEY_OPTIMISM,
ETHERSCAN_API_KEY_ARBITRUM: process.env.ETHERSCAN_API_KEY_ARBITRUM,
ETHERSCAN_API_KEY_POLYGON: process.env.ETHERSCAN_API_KEY_POLYGON,
MORALIS_API_KEY: process.env.MORALIS_API_KEY,
NEXT_PUBLIC_USE_PUBLIC_PROVIDER: process.env.NEXT_PUBLIC_USE_PUBLIC_PROVIDER,
NEXT_PUBLIC_ALCHEMY_API_KEY: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY,
NEXT_PUBLIC_INFURA_API_KEY: process.env.NEXT_PUBLIC_INFURA_API_KEY,
Expand Down
2 changes: 1 addition & 1 deletion template/base/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import './env.mjs'
const nextConfig = {
reactStrictMode: true,
images: {
domains: ['avatars.githubusercontent.com', 'images.unsplash.com', 'cloudflare-ipfs.com'],
domains: ['avatars.githubusercontent.com', 'images.unsplash.com', 'cloudflare-ipfs.com','gateway.ipfs.io'],
},
env: {
mode: process.env.NODE_ENV,
Expand Down
4 changes: 4 additions & 0 deletions template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@
"@gelatonetwork/automate-sdk": "^2.14.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@lit-protocol/lit-node-client": "2.1.161",
"@moralisweb3/common-evm-utils": "^2.22.4",
"@livepeer/react": "^2.6.0",
"@prisma/client": "^4.8.1",
"@pushprotocol/restapi": "^1.3.9",
"@pushprotocol/uiweb": "1.0.1",
"@radix-ui/react-accordion": "^1.1.0",
"@radix-ui/react-alert-dialog": "^1.0.2",
"@radix-ui/react-aspect-ratio": "^1.0.1",
Expand Down Expand Up @@ -91,6 +94,7 @@
"jotai": "^1.13.0",
"luxon": "^3.2.1",
"moment": "^2.29.4",
"moralis": "^2.22.4",
"next": "13.4.0",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit 7464cd1

Please sign in to comment.