ZNEWS
3 Mar 2025Hacker News like platform where you can create accounts, post links, upvote and downvote posts, and comment on posts.
![]()
Features
- Sign-up, Sign-in, Sign-out Accounts.
Create an account in Sign-up page or Login with following account.email : user@gmail.com, password : User123! - Create, Edit and Delete posts
- User input validation for title and link.
- Automatically update user feed after uploading, editing or deleting a post.
- UpVote and DownVote
- Vote posts
- Vote comments
- Optimistic update for UpVotes and DownVotes
- Comment
- Comment on Posts
- Reply comments
- User Profile
- View User Info and Posts
TODOEdit User Info
PostgreSQL Database
DBML Schema
Enum vote_enum {
up
down
}
Table user {
id integer [primary key, increment]
username varchar [unique, not null]
email varchar [unique, not null]
password varchar [not null]
created_at timestamp [default: 'now()']
}
Table post {
id integer [primary key]
title varchar [not null]
link text [not null]
user_id integer [not null]
created_at timestamp [default: 'now()']
}
Table comment {
id integer [primary key]
created_at timestamp [default: 'now()']
post_id integer [not null]
user_id integer [not null]
comment text [not null]
parent_id integer
}
Table vote {
id integer [primary key]
post_id integer [not null]
user_id integer [not null]
created_at timestamp [default: 'now()']
vote vote_enum [default: null]
}
// Relationships (Foreign Keys)
Ref: post.user_id > user.id
Ref: comment.post_id > post.id [delete: cascade]
Ref: comment.user_id > user.id
Ref: comment.parent_id > comment.id
Ref: vote.post_id > post.id
Ref: vote.user_id > user.id
Packages
- Framework- Next.js / React
- Typescript for type safety
- Tailwind CSS for styling
- React-Hook-Form for forms management
- drizzle-orm for Database ORM
- Next-Auth for authentication
- radix-ui for UI components
- zod for schema validation
- @neondatabase/serverless for Database
- @tanstack/react-query for data fetching and caching
Links
©zsphinx2026