├── .babelrc
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── Dockerfile
├── README.md
├── next-env.d.ts
├── next.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── favicon.ico
├── logo.svg
└── vercel.svg
├── scaffold-desktop.png
├── scaffold-mobile.png
├── src
├── components
│ ├── AppBar.tsx
│ ├── ContentContainer.tsx
│ ├── Footer.tsx
│ ├── Notification.tsx
│ ├── RequestAirdrop.tsx
│ ├── SendTransaction.tsx
│ └── SignMessage.tsx
├── contexts
│ ├── AutoConnectProvider.tsx
│ └── ContextProvider.tsx
├── hooks
│ └── useQueryContext.tsx
├── models
│ └── types.ts
├── pages
│ ├── _app.tsx
│ ├── _document.tsx
│ ├── api
│ │ └── hello.ts
│ ├── basics.tsx
│ └── index.tsx
├── stores
│ ├── useNotificationStore.tsx
│ └── useUserSOLBalanceStore.tsx
├── styles
│ └── globals.css
├── utils
│ ├── explorer.ts
│ └── notifications.tsx
└── views
│ ├── basics
│ └── index.tsx
│ ├── home
│ └── index.tsx
│ └── index.tsx
├── tailwind.config.js
├── tsconfig.json
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | { "presets": ["next/babel"] }
2 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | __generated__
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["next/core-web-vitals", "next/babel"]
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env.local
29 | .env.development.local
30 | .env.test.local
31 | .env.production.local
32 |
33 | # vercel
34 | .vercel
35 |
36 | # typescript
37 | *.tsbuildinfo
38 |
39 | # logs
40 | *.log
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:12-alpine
2 |
3 | WORKDIR /opt/app
4 |
5 | ENV NODE_ENV production
6 |
7 | COPY package*.json ./
8 |
9 | RUN npm ci
10 |
11 | COPY . /opt/app
12 |
13 | RUN npm install --dev && npm run build
14 |
15 | CMD [ "npm", "start" ]
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Solana dApp Scaffold Next
3 |
4 | # Note this version is not currently maintained.
5 | ## Please use the newer version: [Solana Dapp Scaffold](https://github.com/solana-labs/dapp-scaffold/)
6 |
7 | ## Older version notes:
8 |
9 | The Solana dApp Scaffold repos are meant to house good starting scaffolds for ecosystem developers to get up and running quickly with a front end client UI that integrates several common features found in dApps with some basic usage examples. Wallet Integration. State management. Components examples. Notificaitons. Setup recommendations.
10 |
11 | Responsive | Desktop
12 | :-------------------------:|:-------------------------:
13 |  | 
14 |
15 | ## Getting Started
16 |
17 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
18 |
19 | The responsive version for wallets and wallet adapter may not function or work as expected for mobile based on plugin and wallet compatibility.
20 |
21 | ## Installation
22 |
23 | ```bash
24 | npm install
25 | # or
26 | yarn install
27 | ```
28 |
29 | ## Build and Run
30 |
31 | Next, run the development server:
32 |
33 | ```bash
34 | npm run dev
35 | # or
36 | yarn dev
37 | ```
38 |
39 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
40 |
41 | You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
42 |
43 | [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
44 |
45 | The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
46 |
47 | ## Features
48 |
49 | Each Scaffold will contain at least the following features:
50 |
51 | ```
52 | Wallet Integration with Auto Connec / Refresh
53 |
54 | State Management
55 |
56 | Components: One or more components demonstrating state management
57 |
58 | Web3 Js: Examples of one or more uses of web3 js including a transaction with a connection provider
59 |
60 | Sample navigation and page changing to demonstate state
61 |
62 | Clean Simple Styling
63 |
64 | Notifications (optional): Example of using a notification system
65 |
66 | ```
67 |
68 | A Solana Components Repo will be released in the near future to house a common components library.
69 |
70 |
71 | ### Structure
72 |
73 | The scaffold project structure may vary based on the front end framework being utilized. The below is an example structure for the Next js Scaffold.
74 |
75 | ```
76 | ├── public : publically hosted files
77 | ├── src : primary code folders and files
78 | │ ├── components : should house anything considered a resuable UI component
79 | │ ├── contexts` : any context considered reusable and useuful to many compoennts that can be passed down through a component tree
80 | │ ├── hooks` : any functions that let you 'hook' into react state or lifecycle features from function components
81 | │ ├── models` : any data structure that may be reused throughout the project
82 | │ ├── pages` : the pages that host meta data and the intended `View` for the page
83 | │ ├── stores` : stores used in state management
84 | │ ├── styles` : contain any global and reusable styles
85 | │ ├── utils` : any other functionality considered reusable code that can be referenced
86 | │ ├── views` : contains the actual views of the project that include the main content and components within
87 | style, package, configuration, and other project files
88 |
89 | ```
90 |
91 | ## Contributing
92 |
93 | Anyone is welcome to create an issue to build, discuss or request a new feature or update to the existing code base. Please keep in mind the following when submitting an issue. We consider merging high value features that may be utilized by the majority of scaffold users. If this is not a common feature or fix, consider adding it to the component library or cookbook. Please refer to the project's architecture and style when contributing.
94 |
95 | If submitting a feature, please reference the project structure shown above and try to follow the overall architecture and style presented in the existing scaffold.
96 |
97 | ### Committing
98 |
99 | To choose a task or make your own, do the following:
100 |
101 | 1. [Add an issue](https://github.com/solana-dev-adv/solana-dapp-next/issues/new) for the task and assign it to yourself or comment on the issue
102 | 2. Make a draft PR referencing the issue.
103 |
104 | The general flow for making a contribution:
105 |
106 | 1. Fork the repo on GitHub
107 | 2. Clone the project to your own machine
108 | 3. Commit changes to your own branch
109 | 4. Push your work back up to your fork
110 | 5. Submit a Pull request so that we can review your changes
111 |
112 | **NOTE**: Be sure to merge the latest from "upstream" before making a
113 | pull request!
114 |
115 | You can find tasks on the [project board](https://github.com/solana-dev-adv/solana-dapp-next/projects/1)
116 | or create an issue and assign it to yourself.
117 |
118 |
119 | ## Learn More Next Js
120 |
121 | To learn more about Next.js, take a look at the following resources:
122 |
123 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
124 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
125 |
126 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
127 |
128 | ## Deploy on Vercel
129 |
130 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
131 |
132 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
133 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | }
5 |
6 | module.exports = nextConfig
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "solana-dapp-next",
3 | "version": "0.1.0",
4 | "license": "MIT",
5 | "private": false,
6 | "scripts": {
7 | "dev": "next dev",
8 | "build": "next build",
9 | "start": "next start",
10 | "lint": "next lint"
11 | },
12 | "dependencies": {
13 | "@heroicons/react": "^1.0.5",
14 | "@solana/wallet-adapter-base": "^0.9.3",
15 | "@solana/wallet-adapter-react": "^0.15.3",
16 | "@solana/wallet-adapter-react-ui": "^0.9.5",
17 | "@solana/wallet-adapter-wallets": "^0.15.3",
18 | "@solana/web3.js": "^1.66.2",
19 | "@tailwindcss/typography": "^0.5.0",
20 | "daisyui": "^1.24.3",
21 | "immer": "^9.0.12",
22 | "next": "^12.3.1",
23 | "next-compose-plugins": "^2.2.1",
24 | "next-transpile-modules": "^9.0.0",
25 | "react": "17.0.2",
26 | "react-dom": "17.0.2",
27 | "tweetnacl": "^1.0.3",
28 | "zustand": "^3.6.9"
29 | },
30 | "devDependencies": {
31 | "@types/node": "17.0.10",
32 | "@types/react": "17.0.38",
33 | "autoprefixer": "^10.4.2",
34 | "eslint": "8.7.0",
35 | "eslint-config-next": "12.0.8",
36 | "postcss": "^8.4.5",
37 | "tailwindcss": "^3.0.15",
38 | "typescript": "4.5.4"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solana-developers/solana-dapp-next/2f3511296ff743c0e91e5c5e358c444cf14d0a00/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo.svg:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scaffold-desktop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solana-developers/solana-dapp-next/2f3511296ff743c0e91e5c5e358c444cf14d0a00/scaffold-desktop.png
--------------------------------------------------------------------------------
/scaffold-mobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solana-developers/solana-dapp-next/2f3511296ff743c0e91e5c5e358c444cf14d0a00/scaffold-mobile.png
--------------------------------------------------------------------------------
/src/components/AppBar.tsx:
--------------------------------------------------------------------------------
1 | import { FC } from 'react';
2 | import Link from "next/link";
3 |
4 | import { WalletMultiButton } from "@solana/wallet-adapter-react-ui";
5 | import { useAutoConnect } from '../contexts/AutoConnectProvider';
6 |
7 | export const AppBar: FC = props => {
8 | const { autoConnect, setAutoConnect } = useAutoConnect();
9 |
10 | return (
11 |