�� � ������� fullstack-�����������. �������� � ������� LifeScript (Next.js App Router + TypeScript + Tailwind + shadcn/ui + Prisma + Neon/Postgres + Auth).
������ ������ ������� �������� LifeScript: ��� ������� �� ������� ��������� �������:
- ����� � ���������� �� createdAt desc
- ���������� � ���������� �� ���������� ������ desc �� ������� ���������� ������ PUBLIC ������. ��� ����������� ������ ������ ������� (���������/�������������/�������/����������� private/public). ����� ����� ������ �������� � (���� �� ����������� �������) ������� � �� ��������������/CRUD ������ ���������.
���������� � UI
- ������� ���� (Header):
- ����/�������� ProStore (������ �� �/�)
- ���������: �������, �������, ��� ������
- ������: ������ �����/����� (� ����������� �� ������), ����-������, ��� (���� ����)
- ������ ���� (Footer):
- �������� �����: (�) LifeScript + ���
- ������: ��������, ��������
- ������� ��������:
- Hero-����: ��������� + ������������ + ������ ��������� �����
- ���� �� �����������: ������ ���� �� /auth/signin (��� ��� ���� ������) � ������������ ��������� ��������, ����� ����������
- ��� ����� �������:
- ������ (��������� 10�20)
- ����������� (��� 10�20 �� likesCount)
- �������� ������ � ������:
- ���������, ����� (���), ����
- ���� (���� ����)
- ������ ��������� (�� �������� ������ /prompts/[id])
- ������� ������ + ������ ����� (���� ����� ��� �����������)
- ������� ������ ��������������/�������� �� �������
- Hero-����: ��������� + ������������ + ������ ��������� �����
- ������������: ������� �� ���������.
���������� � ������
- ������ 2 ������� � �� (��� ���� � ����� ���������) ����� Prisma:
- recentPrompts: where { isPublic: true } orderBy { createdAt: "desc" } take N
- popularPrompts: where { isPublic: true } orderBy �� likesCount desc take N
- ��� ������ ������ likesCount ����� Prisma _count (��� ������� ����������� ����).
- ���� ������������ ����������� � ��� ������ �������� ������ likedByMe (����� ��� ��������� ������ �����).
- �������� ��� ����������: ���� ������ �� promptIds � ������� Like, ����� ���� Set(promptId).
�����������
- ������ ����� Layout:
- app/layout.tsx � �������� Header/Footer
- Header/Footer ��� ��������� ���������� � components/layout/
- ������� ��������:
- app/page.tsx � Server Component
- �������� session (���� ����) � ������ �� Prisma
- �������� ��� ������
- ����������:
- PromptCard (server-safe ��� client-only ��������)
- LikeButton � client component (���� ����� ����)
- Sort/������������� �� ������� �� �����: ��� ��� ������������� �������.
����� �������
- ��������/��������������/�������� ������� � ������������� private/public ������ ���� �������� ������ �������������� ������������� �� ��������������� ��������� (�������� /my).
- �� ������� � � ��������� �������� �������� ��������������.
- ���� �� ������� ���� �������� �������������� � ������ guard: ���� ��� session > redirect �� login ��� 403.
��� ����� �������
- �������� Header/Footer � �������� � ����� layout.
- �������� ������� �������� � ����� �������� ������ � �����������.
- ������� ������ �� Prisma: public prompts + likesCount (+likedByMe ��� ������� ������).
- �������, ��� ����� �� ����� ������ �������������� � �� ����� ������� �������� �������������� ��������.
- ������ ������ ���������� ������ � �������� ��������� ����.
����������
- ��������� shadcn/ui ����������: Card, Button, Badge, Separator, DropdownMenu (��� �������), Skeleton (�����������).
- �� ����� ������������ ����������.
- ���� ��������� ������ ���������� (�������� ���� public ���������� visibility), ������� ����� ���������� �������� � prisma.schema � �������� ���.