차이 존나 많이 남
실무에서 지피티쓰고있었는데 클로드 갈아탈만 한듯
리액트, 노드js
개발자 포폴 웹사이트 코드 작성 시켰음
기본 예제 말고 현업 개발자 수준으로 작성하라고 강조함
Gpt4는 공식문서 첫페이지 수준의 기본 예제를 뱉었고
컴포넌트는 하나만 뱉었음
쓰는게 의미 없는 수준의 코드였음
클로드는 useeffect, usestate, js 함수를 다양하게 써서
Fetch 등 포함된 컴포넌트 전부 뱉음
백엔드는 db와 간단한 메일 전송 기능도 붙여줌
이것도 실무에 쓸 수준은 아니지만 훨씬 나음
코드 너무 길어서 백엔드만 아래 가져옴
<<< Gpt4 >>>
const express = require('express');
const cors = require('cors');
require('dotenv').config();
const app = express();
const port = process.env.PORT || 5000;
app.use(cors());
app.use(express.json());
app.get('/api/projects', (req, res) => {
res.json([
{ id: 1, title: '프로젝트 1', deion: '프로젝트 1에 대한 설명', image: 'project1.png' },
{ id: 2, title: '프로젝트 2', deion: '프로젝트 2에 대한 설명', image: 'project2.png' },
// 추가 프로젝트 정보
]);
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
<<< 클로드 무료버전 >>>
// server.js
const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
const nodemailer = require('nodemailer');
const app = express();
const PORT = process.env.PORT || 5000;
// Middleware
app.use(express.json());
app.use(cors());
// MongoDB connection
mongoose.connect('mongodb://localhost/portfolio', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
// Define your schema and model
const projectSchema = new mongoose.Schema({
title: String,
deion: String,
// Add more fields as needed
});
const Project = mongoose.model('Project', projectSchema);
// API endpoints
app.get('/api/projects', async (req, res) => {
try {
const projects = await Project.find();
res.json(projects);
} catch (error) {
console.error('Error fetching projects:', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.post('/api/contact', async (req, res) => {
try {
const { name, email, message } = req.body;
// Configure your email transporter
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'your-email@gmail.com',
pass: 'your-email-password',
},
});
// Define the email options
const mailOptions = {
from: 'your-email@gmail.com',
to: 'recipient-email@example.com',
subject: 'New Message from Portfolio Website',
text: `Name: ${name}\nEmail: ${email}\nMessage: ${message}`,
};
// Send the email
await transporter.sendMail(mailOptions);
res.status(200).json({ message: 'Message sent successfully' });
} catch (error) {
console.error('Error sending message:', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
실무에서 지피티쓰고있었는데 클로드 갈아탈만 한듯
리액트, 노드js
개발자 포폴 웹사이트 코드 작성 시켰음
기본 예제 말고 현업 개발자 수준으로 작성하라고 강조함
Gpt4는 공식문서 첫페이지 수준의 기본 예제를 뱉었고
컴포넌트는 하나만 뱉었음
쓰는게 의미 없는 수준의 코드였음
클로드는 useeffect, usestate, js 함수를 다양하게 써서
Fetch 등 포함된 컴포넌트 전부 뱉음
백엔드는 db와 간단한 메일 전송 기능도 붙여줌
이것도 실무에 쓸 수준은 아니지만 훨씬 나음
코드 너무 길어서 백엔드만 아래 가져옴
<<< Gpt4 >>>
const express = require('express');
const cors = require('cors');
require('dotenv').config();
const app = express();
const port = process.env.PORT || 5000;
app.use(cors());
app.use(express.json());
app.get('/api/projects', (req, res) => {
res.json([
{ id: 1, title: '프로젝트 1', deion: '프로젝트 1에 대한 설명', image: 'project1.png' },
{ id: 2, title: '프로젝트 2', deion: '프로젝트 2에 대한 설명', image: 'project2.png' },
// 추가 프로젝트 정보
]);
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
<<< 클로드 무료버전 >>>
// server.js
const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
const nodemailer = require('nodemailer');
const app = express();
const PORT = process.env.PORT || 5000;
// Middleware
app.use(express.json());
app.use(cors());
// MongoDB connection
mongoose.connect('mongodb://localhost/portfolio', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
// Define your schema and model
const projectSchema = new mongoose.Schema({
title: String,
deion: String,
// Add more fields as needed
});
const Project = mongoose.model('Project', projectSchema);
// API endpoints
app.get('/api/projects', async (req, res) => {
try {
const projects = await Project.find();
res.json(projects);
} catch (error) {
console.error('Error fetching projects:', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.post('/api/contact', async (req, res) => {
try {
const { name, email, message } = req.body;
// Configure your email transporter
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'your-email@gmail.com',
pass: 'your-email-password',
},
});
// Define the email options
const mailOptions = {
from: 'your-email@gmail.com',
to: 'recipient-email@example.com',
subject: 'New Message from Portfolio Website',
text: `Name: ${name}\nEmail: ${email}\nMessage: ${message}`,
};
// Send the email
await transporter.sendMail(mailOptions);
res.status(200).json({ message: 'Message sent successfully' });
} catch (error) {
console.error('Error sending message:', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
좀 있다 5 나오니까 그것도 비교점
ㅇㅋㅇㅋ 나도 기대중
헉 클로드 무료버전으로 -_- 유료로 해보면 훨씬 더 좋겠네
과연 리액트 철학에 맞게 작성됐을까 - dc App