Skip to content

Alexandria-s-Design/NFT-idea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eternal Moments - NFT Platform

A platform for turning special life moments into NFTs. Built with Laravel (Backend), Vue.js (Frontend), and Laravel Nova (Admin Panel).

Overview

Eternal Moments allows users to create, mint, and sell NFTs from their precious life moments. The platform supports images, videos, and audio files, with integrated payment processing through both cryptocurrency wallets and credit cards.

Features

User Features

  • User Registration & Authentication: Separate roles for creators and buyers
  • NFT Creation: Upload images, videos, or audio files
  • NFT Minting: Mint NFTs on the blockchain via Venly API
  • NFT Marketplace: Browse and purchase NFTs
  • Wallet Integration: Connect MetaMask and other Web3 wallets
  • Payment Options: Pay with crypto or credit card (Stripe)
  • Dashboard: Track NFT performance, views, and earnings
  • Shareable Links: Unique shareable URLs for each NFT

Admin Features

  • User Management: View and manage all users
  • NFT Management: Monitor all NFTs and their status
  • Transaction Tracking: View all platform transactions
  • Wallet Management: Oversee connected wallets

Tech Stack

Backend

  • Framework: Laravel 10
  • Database: MySQL (AWS RDS)
  • Authentication: Laravel Sanctum
  • Admin Panel: Laravel Nova
  • Storage: AWS S3
  • NFT API: Venly
  • Payment: Stripe

Frontend

  • Framework: Vue.js 3
  • Build Tool: Vite
  • State Management: Pinia
  • Routing: Vue Router
  • Styling: Tailwind CSS
  • Web3: Ethers.js
  • HTTP Client: Axios

Infrastructure

  • Backend Hosting: AWS EC2
  • Frontend Hosting: AWS Amplify
  • File Storage: AWS S3
  • Database: AWS RDS

Project Structure

NFT-idea/
├── backend/                 # Laravel backend
│   ├── app/
│   │   ├── Http/
│   │   │   └── Controllers/ # API controllers
│   │   ├── Models/          # Eloquent models
│   │   ├── Services/        # Business logic services
│   │   └── Nova/            # Laravel Nova resources
│   ├── database/
│   │   └── migrations/      # Database migrations
│   ├── routes/
│   │   └── api.php          # API routes
│   └── config/              # Configuration files
│
└── frontend/                # Vue.js frontend
    ├── src/
    │   ├── components/      # Vue components
    │   ├── views/           # Page components
    │   ├── stores/          # Pinia stores
    │   ├── services/        # API services
    │   └── router/          # Vue Router config
    └── public/              # Static assets

Installation

Prerequisites

  • PHP 8.1+
  • Composer
  • Node.js 18+
  • MySQL 8.0+
  • AWS Account
  • Stripe Account
  • Venly Account

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
composer install
  1. Copy environment file:
cp .env.example .env
  1. Configure your .env file with:

    • Database credentials
    • AWS credentials (S3, RDS)
    • Stripe API keys
    • Venly API credentials
    • Frontend URL
  2. Generate application key:

php artisan key:generate
  1. Run migrations:
php artisan migrate
  1. Install Laravel Nova (requires license):
composer require laravel/nova
php artisan nova:install
  1. Start the development server:
php artisan serve

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Copy environment file:
cp .env.example .env
  1. Configure your .env file:
VITE_API_URL=http://localhost:8000/api
VITE_STRIPE_PUBLIC_KEY=your_stripe_public_key
VITE_APP_URL=http://localhost:3000
  1. Start the development server:
npm run dev

The application will be available at:

API Documentation

Authentication Endpoints

Register

POST /api/register
Content-Type: application/json

{
  "name": "John Doe",
  "email": "john@example.com",
  "password": "password123",
  "password_confirmation": "password123",
  "user_type": "creator"
}

Login

POST /api/login
Content-Type: application/json

{
  "email": "john@example.com",
  "password": "password123"
}

Logout

POST /api/logout
Authorization: Bearer {token}

NFT Endpoints

Get All NFTs

GET /api/nfts?status=listed&occasion=wedding

Get Single NFT

GET /api/nfts/{id}

Get NFT by Share URL

GET /api/nfts/share/{shareUrl}

Create NFT

POST /api/nfts
Authorization: Bearer {token}
Content-Type: multipart/form-data

{
  "title": "My Wedding Day",
  "description": "Our special moment",
  "media_type": "image",
  "media_file": [file],
  "occasion": "wedding",
  "price": 0.5,
  "currency": "ETH"
}

Mint NFT

POST /api/nfts/{id}/mint
Authorization: Bearer {token}

Update NFT

PUT /api/nfts/{id}
Authorization: Bearer {token}

{
  "title": "Updated Title",
  "price": 1.0
}

Transaction Endpoints

Purchase NFT

POST /api/nfts/{nftId}/purchase
Authorization: Bearer {token}

{
  "payment_method": "crypto",
  "wallet_address": "0x..."
}

Get User Transactions

GET /api/transactions
Authorization: Bearer {token}

Wallet Endpoints

Connect Wallet

POST /api/wallets/connect
Authorization: Bearer {token}

{
  "address": "0x...",
  "blockchain": "MATIC",
  "wallet_type": "metamask"
}

Get User Wallets

GET /api/wallets
Authorization: Bearer {token}

Deployment

Backend Deployment (AWS EC2)

  1. Launch an EC2 instance (Ubuntu 22.04 recommended)
  2. Install PHP, Composer, and required extensions
  3. Clone the repository
  4. Configure environment variables
  5. Set up nginx or Apache
  6. Configure SSL with Let's Encrypt
  7. Run migrations and seed data

Frontend Deployment (AWS Amplify)

  1. Connect your Git repository to AWS Amplify
  2. Configure build settings:
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - cd frontend
        - npm install
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: frontend/dist
    files:
      - '**/*'
  cache:
    paths:
      - frontend/node_modules/**/*
  1. Set environment variables in Amplify console
  2. Deploy

Database Setup (AWS RDS)

  1. Create a MySQL RDS instance
  2. Configure security groups
  3. Update backend .env with RDS credentials
  4. Run migrations

Storage Setup (AWS S3)

  1. Create an S3 bucket
  2. Configure CORS policy
  3. Set up IAM user with S3 access
  4. Update backend .env with S3 credentials

Environment Variables

Backend (.env)

APP_NAME="Eternal Moments"
APP_ENV=production
APP_KEY=
APP_URL=https://api.eternalmoments.com

DB_CONNECTION=mysql
DB_HOST=your-rds-endpoint
DB_DATABASE=eternal_moments
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket-name

STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=

VENLY_API_KEY=
VENLY_API_SECRET=
VENLY_ENVIRONMENT=production
VENLY_CHAIN=MATIC

FRONTEND_URL=https://eternalmoments.com

Frontend (.env)

VITE_API_URL=https://api.eternalmoments.com/api
VITE_STRIPE_PUBLIC_KEY=pk_live_...
VITE_APP_URL=https://eternalmoments.com

Testing

Backend Tests

cd backend
php artisan test

Frontend Tests

cd frontend
npm run test

Security

  • All API routes are protected with Laravel Sanctum authentication
  • File uploads are validated and sanitized
  • CORS is configured to only allow requests from the frontend domain
  • Stripe webhooks are verified using webhook signatures
  • Sensitive data is encrypted in the database

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is proprietary software. All rights reserved.

Support

For support, email support@eternalmoments.com or visit our help center.

Acknowledgments

  • Laravel Framework
  • Vue.js
  • Venly NFT API
  • Stripe Payment Processing
  • AWS Cloud Services

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors