Add occupation

This commit is contained in:
MartinBraquet
2025-07-31 01:52:30 +02:00
parent 458e8f3c2d
commit cacab9a32d
3 changed files with 78 additions and 24 deletions

View File

@@ -96,7 +96,7 @@ export default function Post() {
{user?.profile?.desiredConnections.map((value, idx) => (
<li
key={idx}
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 rounded-full hover:bg-gray-200 transition"
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 dark:text-white dark:bg-gray-700 rounded-full hover:bg-gray-200 transition"
>
{value?.connection?.name}
</li>
@@ -141,7 +141,7 @@ export default function Post() {
{user.profile.intellectualInterests.map((value, idx) => (
<li
key={idx}
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 rounded-full hover:bg-gray-200 transition"
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 dark:text-white dark:bg-gray-700 rounded-full hover:bg-gray-200 transition"
>
{value?.interest?.name}
</li>
@@ -158,7 +158,7 @@ export default function Post() {
{user.profile.causeAreas.map((value, idx) => (
<li
key={idx}
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 rounded-full hover:bg-gray-200 transition"
className="px-3 py-1 text-sm bg-blue-100 text-blue-800 dark:text-white dark:bg-gray-700 rounded-full hover:bg-gray-200 transition"
>
{value?.causeArea?.name}
</li>

View File

@@ -35,6 +35,7 @@ model Profile {
location String? // Need to normalize later for geospatial
description String?
contactInfo String?
occupation String?
gender Gender?
personalityType PersonalityType?
conflictStyle ConflictStyle?

View File

@@ -6,14 +6,72 @@ const prisma = new PrismaClient({log: ['query']})
async function main() {
type ProfileBio = {
name: string;
age: number;
occupation: string;
location: string;
bio: string;
interests: string[];
};
const profiles: ProfileBio[] = [
{
name: "Elena",
age: 29,
occupation: "Cognitive Science Researcher",
location: "Berlin, Germany",
bio: "Im passionate about understanding the limits and mechanics of human reasoning. I spend weekends dissecting papers on decision theory and evenings debating moral uncertainty. If you know your way around LessWrong and thought experiments, well get along.",
interests: ["Bayesian epistemology", "AI alignment", "Effective Altruism", "Meditation", "Game Theory"]
},
{
name: "Marcus",
age: 34,
occupation: "Software Engineer",
location: "San Francisco, USA",
bio: "Practicing instrumental rationality one well-calibrated belief at a time. Stoicism and startup life have taught me a lot about tradeoffs. Looking for someone who can argue in good faith and loves truth-seeking as much as I do.",
interests: ["Stoicism", "Predictive processing", "Rational fiction", "Startups", "Causal inference"]
},
{
name: "Aya",
age: 26,
occupation: "Philosophy PhD Candidate",
location: "Oxford, UK",
bio: "My research focuses on metaethics and formal logic, but my heart belongs to moral philosophy. I think a lot about personhood, consciousness, and the ethics of future civilizations. Let's talk about Rawls or Parfit over tea.",
interests: ["Metaethics", "Consciousness", "Transhumanism", "Moral realism", "Formal logic"]
},
{
name: "David",
age: 41,
occupation: "Data Scientist",
location: "Toronto, Canada",
bio: "Former humanities major turned quant. Still fascinated by existential risk, the philosophy of science, and how to stay sane in an uncertain world. I'm here to meet people who think weird is a compliment.",
interests: ["Probability theory", "Longtermism", "Epistemic humility", "Futurology", "Meditation"]
},
{
name: "Mei",
age: 31,
occupation: "Independent Writer",
location: "Singapore",
bio: "Writing essays on intellectual humility, the philosophy of language, and how thinking styles shape our lives. I appreciate calm reasoning, rigorous curiosity, and the beauty of well-defined concepts. Let's try to model each other's minds.",
interests: ["Philosophy of language", "Bayesian reasoning", "Writing", "Dialectics", "Systems thinking"]
}
];
const interests = new Set<string>();
profiles.forEach(profile => {
profile.interests.forEach(interest => {
interests.add(interest);
});
});
console.log([...interests]);
// Create some interests and cause areas
await prisma.interest.createMany({
data: [
{name: 'Philosophy'},
{name: 'AI Safety'},
{name: 'Economics'},
{name: 'Mathematics'},
],
data: [...interests].map(interest => ({name: interest})),
skipDuplicates: true,
});
@@ -35,13 +93,6 @@ async function main() {
skipDuplicates: true,
});
const names = [
'Alice Wonderland',
'Bob the Builder',
'Emily McConaughey',
'Alex Hepburn',
'Laurent Golden'
]
// Get actual Interest & CauseArea objects
const allInterests = await prisma.interest.findMany();
@@ -50,29 +101,31 @@ async function main() {
// Create mock users
for (let i = 0; i < 5; i++) {
const profile = profiles[i];
const user = await prisma.user.create({
data: {
email: `user${i+1}@bayesbond.com`,
name: names[i],
email: `user${i + 1}@bayesbond.com`,
name: profile.name,
image: null,
profile: {
create: {
location: i % 2 === 0 ? 'New York' : 'San Francisco',
description: '[Dummy profile for demo purposes] Im a data scientist with a deep interest in decision theory, AI alignment, and effective altruism. When Im not analyzing models or debating Bayesian reasoning, I enjoy exploring behavioral economics and reading philosophy (Kant and Parfit are favorites). Looking to connect with others who value curiosity, intellectual honesty, and constructive debate. Open to collaborating on research, causal impact projects, or just good conversations over coffee.',
location: profile.location,
description: `[Dummy profile for demo purposes] ${profile.bio}`,
gender: i % 2 === 0 ? 'Male' : 'Female',
personalityType: i % 3 === 0 ? 'Extrovert' : 'Introvert',
conflictStyle: 'Avoidant',
contactInfo: `Email: user${i}@bayesbond.com\nPhone: +1 (123) 456-7890`,
occupation: profile.occupation,
desiredConnections: {
create: [
{connectionId: allConnections[i % allConnections.length].id},
],
},
intellectualInterests: {
create: [
{interestId: allInterests[i % allInterests.length].id},
{interestId: allInterests[(i + 1) % allInterests.length].id},
],
// create: [...allInterests].map(interest => ({interestId: interest.id}) && Set(profile.interests))
create: allInterests
.filter(e => (new Set(profile.interests)).has(e.name)) // keep only elements in the set
.map(e => ({interestId: e.id})) // map to object with `a` key
},
causeAreas: {
create: [