-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main color selected, preview images, network data added, contract add…
…resses etc
- Loading branch information
0 parents
commit 7f0f8ed
Showing
137 changed files
with
56,541 additions
and
0 deletions.
There are no files selected for viewing
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,17 @@ | ||
ARWEAVE_ADDRESS= | ||
ARWEAVE_KTY= | ||
ARWEAVE_N= | ||
ARWEAVE_E= | ||
ARWEAVE_D= | ||
ARWEAVE_P= | ||
ARWEAVE_Q= | ||
ARWEAVE_DP= | ||
ARWEAVE_DQ= | ||
ARWEAVE_QI= | ||
FILE_UPLOAD_SERVICE= | ||
IMAGEKIT_ENDPOINT= | ||
IMAGEKIT_PUBLIC_KEY= | ||
IMAGEKIT_PRIVATE_KEY= | ||
LINK_PREVIEW_SERVICE= | ||
RPC_CUSTOM= | ||
TENOR_KEY= |
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,33 @@ | ||
name: Mirroring | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
to_bitbucket: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: # <-- must use actions/checkout before mirroring! | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pixta-dev/repository-mirroring-action@v1 | ||
with: | ||
target_repo_url: | ||
[email protected]:punk-domains/meow-nfts.git | ||
ssh_private_key: # <-- use 'secrets' to pass credential information. | ||
${{ secrets.MIRROR_KEY }} | ||
|
||
to_gitlab: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: # <-- must use actions/checkout before mirroring! | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pixta-dev/repository-mirroring-action@v1 | ||
with: | ||
target_repo_url: | ||
[email protected]:iggy-social/meow-nfts.git | ||
ssh_private_key: # <-- use 'secrets' to pass credential information. | ||
${{ secrets.MIRROR_KEY }} |
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,12 @@ | ||
node_modules | ||
*.log* | ||
.nuxt | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist | ||
|
||
# Local Netlify folder | ||
.netlify | ||
.vercel |
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,143 @@ | ||
# meowNFTs | ||
|
||
The first NFT launchpad and marketplace on Superposition. | ||
|
||
Link: https://meownfts.com | ||
|
||
## .env | ||
|
||
Create a `.env` file from `.env.example`. | ||
|
||
> Make sure to also enter these vars in your hosting settings! | ||
## Hosting | ||
|
||
We recommend to use Netlify for hosting the site. Netlify allows you to easily deploy the site from this repo (or from a fork of this repository). | ||
|
||
Make sure to use the the `npm run generate` command instead of `npm run build` for build instructions on Netlify. | ||
|
||
If you want to use optional features such as GIFs and image upload, make sure to enter proper environment variables (see `.env.example`). | ||
|
||
Make sure to also select the proper serverless functions services in your environment variables, for example: | ||
|
||
```bash | ||
FILE_UPLOAD_SERVICE=netlify | ||
LINK_PREVIEW_SERVICE=netlify | ||
``` | ||
|
||
You can also set these in the Nuxt config file (`nuxt.config.ts`). | ||
|
||
### 4everland | ||
|
||
[4everland](https://4everland.org/) is a decentralized hosting provider which stores your website on IPFS. | ||
|
||
If you have your code on GitHub, the `build.yml` script will build your app via GitHub Actions and create a `build` branch. | ||
|
||
Make sure you add all the necessary env vars (tenor etc.) to the organization variables for actions on GitHub. | ||
|
||
Also make sure you have Workflow permissions on the organization level on GitHub set to read & write. | ||
|
||
Then, when you create a project on 4everland, make sure you select the `build` branch. | ||
|
||
And in the build section delete the command and set build folder to empty (or `./`). The preset can be set to `Other`. No install command is needed either. | ||
|
||
![](https://bafkreid6mzglrk5hklraua267sker6gqsfpy2ezmjj7yc2oqmx2arbynru.ipfs.w3s.link) | ||
|
||
## GIFs (Tenor) | ||
|
||
If you want to have GIF search implemented, create your own Tenor API Key on Google Cloud Console. Follow the instructions here: https://developers.google.com/tenor/guides/quickstart. | ||
|
||
Then enter the key in environment variables (`TENOR_KEY`). | ||
|
||
## Image upload (Arweave) | ||
|
||
To support image uploads, create an Arweave Wallet (e.g. here: https://arweave.app/) and send some AR to it. | ||
|
||
Then go to the wallet settings and download Backup Keyfile. | ||
|
||
In this file you'll find 10 different variables, enter these into your .env file: | ||
|
||
```bash | ||
ARWEAVE_KTY= | ||
ARWEAVE_N= | ||
ARWEAVE_E= | ||
ARWEAVE_D= | ||
ARWEAVE_P= | ||
ARWEAVE_Q= | ||
ARWEAVE_DP= | ||
ARWEAVE_DQ= | ||
ARWEAVE_QI= | ||
``` | ||
|
||
And add the arweave address too: | ||
|
||
```bash | ||
ARWEAVE_ADDRESS= | ||
``` | ||
|
||
Also make sure these variables are set on your hosting provider (Netlify, Vercel, etc). | ||
|
||
## ImageKit upload | ||
|
||
It is recommended to use ImageKit as the fallback option, in case Arweave has technical issues. | ||
|
||
For this to work, create an account at [ImageKit.io](https://imagekit.io/) and add these environment variables to your project: | ||
|
||
```bash | ||
IMAGEKIT_ENDPOINT= | ||
IMAGEKIT_PUBLIC_KEY= | ||
IMAGEKIT_PRIVATE_KEY= | ||
``` | ||
|
||
You can also use ImageKit as your main image upload, if you set the `fileUploadStorageType` variable in nuxt config to "imagekit". | ||
|
||
## Customize | ||
|
||
- Project-specific settings in `nuxt.config.ts` | ||
- CSS files in the `/public/css/` folder | ||
- Favicon and cover/preview images in `/public/img/` folder | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# yarn | ||
yarn install | ||
|
||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install --shamefully-hoist | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on http://localhost:3000 | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
Or run Netlify dev server on http://localhost:8888 (to get link previews): | ||
|
||
```bash | ||
netlify dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
npm run generate | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
npm run preview | ||
``` | ||
|
||
Checkout the [deployment documentation](https://v3.nuxtjs.org/guide/deploy/presets) for more information. |
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,3 @@ | ||
# Vercel serverless function | ||
|
||
This folder contains serverless functions for Vercel. |
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,61 @@ | ||
import Arweave from 'arweave'; | ||
import { Buffer } from 'buffer'; | ||
|
||
export default async function handler(req, res) { | ||
// Check if the request method is POST | ||
if (req.method !== 'POST') { | ||
return res.status(405).json({ message: 'Method Not Allowed' }); | ||
} | ||
|
||
try { | ||
const { fileData, fileName, fileType } = req.body; | ||
|
||
// Initialize Arweave | ||
const arweave = Arweave.init({ | ||
host: 'arweave.net', | ||
port: 443, | ||
protocol: 'https' | ||
}); | ||
|
||
// Construct the key file object from environment variables | ||
const keyFile = { | ||
kty: process.env.ARWEAVE_KTY, | ||
n: process.env.ARWEAVE_N, | ||
e: process.env.ARWEAVE_E, | ||
d: process.env.ARWEAVE_D, | ||
p: process.env.ARWEAVE_P, | ||
q: process.env.ARWEAVE_Q, | ||
dp: process.env.ARWEAVE_DP, | ||
dq: process.env.ARWEAVE_DQ, | ||
qi: process.env.ARWEAVE_QI | ||
}; | ||
|
||
// Convert base64 file data to buffer | ||
const fileBuffer = Buffer.from(fileData, 'base64'); | ||
|
||
// Create a transaction | ||
const transaction = await arweave.createTransaction({ data: fileBuffer }, keyFile); | ||
|
||
// Add tags to the transaction | ||
transaction.addTag('Content-Type', fileType); | ||
transaction.addTag('File-Name', fileName); | ||
|
||
// Sign the transaction | ||
await arweave.transactions.sign(transaction, keyFile); | ||
|
||
// Submit the transaction | ||
const response = await arweave.transactions.post(transaction); | ||
|
||
if (response.status === 200) { | ||
return res.status(200).json({ | ||
message: 'File uploaded successfully', | ||
transactionId: transaction.id | ||
}); | ||
} else { | ||
throw new Error('Failed to upload file to Arweave'); | ||
} | ||
} catch (error) { | ||
console.error('Error:', error); | ||
return res.status(500).json({ message: 'Internal server error' }); | ||
} | ||
} |
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,18 @@ | ||
const ImageKit = require('imagekit') | ||
|
||
export default async function handler(request, response) { | ||
try { | ||
const imagekit = new ImageKit({ | ||
urlEndpoint: process.env.IMAGEKIT_ENDPOINT, | ||
publicKey: process.env.IMAGEKIT_PUBLIC_KEY, | ||
privateKey: process.env.IMAGEKIT_PRIVATE_KEY, | ||
}) | ||
|
||
return response.status(200).json({ | ||
data: imagekit.getAuthenticationParameters(), | ||
}) | ||
} catch (error) { | ||
console.error(error) | ||
next(error) | ||
} | ||
} |
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,12 @@ | ||
const { fetchMetadata } = require('../utils/linkPreviewUtils'); | ||
|
||
export default async function handler(request, response) { | ||
const url = request.query.url; | ||
|
||
const { metadata, status } = await fetchMetadata(url); | ||
|
||
return response.status(status).json({ | ||
data: metadata | ||
}); | ||
|
||
}; |
Oops, something went wrong.