Skip to content

Commit

Permalink
main color selected, preview images, network data added, contract add…
Browse files Browse the repository at this point in the history
…resses etc
  • Loading branch information
tempe-techie committed Oct 2, 2024
0 parents commit 7f0f8ed
Show file tree
Hide file tree
Showing 137 changed files with 56,541 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .env.example
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=
33 changes: 33 additions & 0 deletions .github/workflows/mirror.yml
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 }}
12 changes: 12 additions & 0 deletions .gitignore
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
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

143 changes: 143 additions & 0 deletions README.md
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.
3 changes: 3 additions & 0 deletions api/_readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Vercel serverless function

This folder contains serverless functions for Vercel.
61 changes: 61 additions & 0 deletions api/arweaveUploader.js
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' });
}
}
18 changes: 18 additions & 0 deletions api/imageKitUploader.js
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)
}
}
12 changes: 12 additions & 0 deletions api/linkPreviews.js
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
});

};
Loading

0 comments on commit 7f0f8ed

Please sign in to comment.