-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
1,482 additions
and
1,108 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,67 @@ | ||
# A template to build a full stack app on Aptos | ||
# Aptos full stack template UI | ||
|
||
Please read each directory's readme carefully to understand how to use the template. | ||
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). | ||
|
||
This template is an alternative template to [CAD (create-aptos-dapp)](https://aptos.dev/en/build/create-aptos-dapp). Some notable differences are: | ||
## Local development | ||
|
||
- This template uses more experimental features, such as [indexer-sdk](https://github.com/aptos-labs/aptos-indexer-processor-sdk). | ||
- This template uses Next.js instead of Vite. | ||
- This templates doesn't support Windows. | ||
- CAD provides more production ready templates that have been audited like token minting, NFT minting, etc. | ||
This template uses `@neondatabase/serverless` to connect to a Postgres database. When testing locally, you can connect to a dev branch of neon DB. | ||
|
||
## Create a read only user in DB | ||
|
||
Frontend should only read from the DB, the indexer is the only one that writes to the DB. So, create a read only user in the DB for frontend to use prevent any accidental write operations. | ||
|
||
```sql | ||
-- Create a readonly user | ||
-- Please don't use any special characters in the password to avoid db sdk give invalid connection string error | ||
CREATE USER readonly WITH PASSWORD 'strong_password' | ||
-- Grant readonly user read access to all tables in public schema | ||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; | ||
-- Grant readonly user read access to all future tables in public schema | ||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; | ||
``` | ||
|
||
Some useful SQLs to check the user and schema: | ||
|
||
```sql | ||
-- Get all users | ||
SELECT * FROM pg_user; | ||
-- Get all schemas | ||
SELECT schema_name FROM information_schema.schemata; | ||
``` | ||
|
||
Then fill the `POSTGRES_URL` in `.env` file with the readonly user. | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
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. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Aptos related files | ||
.aptos | ||
.env | ||
contract/build | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
build | ||
dist-ssr | ||
*.local | ||
package-lock.json | ||
pnpm-lock.yaml | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.next |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
templates/indexer-template/contracts/message-board/README.MD
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
templates/indexer-template/contracts/message-board/contract_address.txt
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
templates/indexer-template/contracts/message-board/sh_scripts/deploy.sh
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
templates/indexer-template/contracts/message-board/sh_scripts/get_abis.sh
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.