Deepseek ArtifactsDeepseek Artifacts

Revolutionize Your Book Publishing with Our Beautiful App

4.0
en
Technology
book publishing
easy to use
digital marketplace
self-publishing
payment integration

Prompt

Listen to me, it is a beautiful application for books. Anyone can put his account and bank card and put the book that I want to publish in it and specify the price that he wants. When the purchase process is completed, the amount goes to his card. I want the application to be easy to use and beautiful in all aspects.

Generated Result

import React, { useState } from 'react';

const App = () => {
  const [user, setUser] = useState(null);
  const [books, setBooks] = useState([]);
  const [selectedBook, setSelectedBook] = useState(null);
  const [paymentInfo, setPaymentInfo] = useState({ cardNumber: '', expiryDate: '', cvv: '' });

  const handleLogin = (e) => {
    e.preventDefault();
    setUser({ name: 'John Doe', email: '[email protected]' });
  };

  const handleAddBook = (e) => {
    e.preventDefault();
    const newBook = { id: books.length + 1, title: 'New Book', price: 20 };
    setBooks([...books, newBook]);
  };

  const handlePurchase = (e) => {
    e.preventDefault();
    alert('Purchase completed!');
  };

  return (
    <div className="min-h-screen bg-gray-100">
      <header className="bg-blue-600 text-white p-4">
        <h1 className="text-2xl font-bold">Book Publishing App</h1>
      </header>

      <main className="p-4">
        {!user ? (
          <form onSubmit={handleLogin} className="bg-white p-6 rounded-lg shadow-md">
            <h2 className="text-xl font-semibold mb-4">Login</h2>
            <input type="email" placeholder="Email" className="w-full p-2 mb-4 border rounded" required />
            <input type="password" placeholder="Password" className="w-full p-2 mb-4 border rounded" required />
            <button type="submit" className="w-full bg-blue-600 text-white p-2 rounded">Login</button>
          </form>
        ) : (
          <div>
            <div className="bg-white p-6 rounded-lg shadow-md mb-4">
              <h2 className="text-xl font-semibold mb-4">Add a Book</h2>
              <form onSubmit={handleAddBook}>
                <input type="text" placeholder="Book Title" className="w-full p-2 mb-4 border rounded" required />
                <input type="number" placeholder="Price" className="w-full p-2 mb-4 border rounded" required />
                <button type="submit" className="w-full bg-blue-600 text-white p-2 rounded">Add Book</button>
              </form>
            </div>

            <div className="bg-white p-6 rounded-lg shadow-md mb-4">
              <h2 className="text-xl font-semibold mb-4">Books Available</h2>
              <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
                {books.map((book) => (
                  <div key={book.id} className="border p-4 rounded-lg">
                    <h3 className="text-lg font-semibold">{book.title}</h3>
                    <p className="text-gray-600">${book.price}</p>
                    <button onClick={() => setSelectedBook(book)} className="mt-2 bg-blue-600 text-white p-2 rounded w-full">Purchase</button>
                  </div>
                ))}
              </div>
            </div>

            {selectedBook && (
              <div className="bg-white p-6 rounded-lg shadow-md">
                <h2 className="text-xl font-semibold mb-4">Purchase {selectedBook.title}</h2>
                <form onSubmit={handlePurchase}>
                  <input type="text" placeholder="Card Number" className="w-full p-2 mb-4 border rounded" required />
                  <input type="text" placeholder="Expiry Date" className="w-full p-2 mb-4 border rounded" required />
                  <input type="text" placeholder="CVV" className="w-full p-2 mb-4 border rounded" required />
                  <button type="submit" className="w-full bg-blue-600 text-white p-2 rounded">Complete Purchase</button>
                </form>
              </div>
            )}
          </div>
        )}
      </main>

      <footer className="bg-gray-800 text-white p-4 mt-8">
        <p className="text-center">© 2025 Book Publishing App. All rights reserved.</p>
      </footer>
    </div>
  );
};

export default App;

More Recommendations

View All

Build ChatGPT-Like Web Interface

4.0
Software Development
en
AI Integration
Full-Stack Development
ChatGPT
UI Design
Backend Orchestration
You are a professional full-stack developer AI with deep experience in building AI-integrated UIs, backend orchestration, and vector memory systems. I want you to build a **web-based ChatGPT-like int...

Flutter 产品列表页

4.0
编程开发
en
Flutter
Dart
产品列表
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Flutter产品列表页

4.0
编程开发
en
Flutter
产品列表
Widget
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Build XO App with AI

4.0
Programming
en
Tic Tac Toe
AI Game
JavaScript
create a complete XO (Tic Tac Toe) app with AI opponent: "Build a modern, fully-featured Tic Tac Toe (XO) app that includes: A clean, user-friendly interface optimized for mobile, tablet, and web. ...

Generate YouTube Subscribers

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...

YouTube Subscribers App

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...