Skip to content

feat: implementation of whole application architecture#46

Merged
iamanishx merged 19 commits into
p-society:mainfrom
sam28u:thread-post-creation
Mar 1, 2026
Merged

feat: implementation of whole application architecture#46
iamanishx merged 19 commits into
p-society:mainfrom
sam28u:thread-post-creation

Conversation

@sam28u

@sam28u sam28u commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

implemented some data fetching works

  1. google auth image fetch to profile page
  2. stats updated based on database values
  3. added threads ( fetched ) to profile page (/profile/username) page
  4. fetched thread count under each topics (homepage)
  5. implemented thread view functionality (no of views per thread - same user is count unique when viewed same thread)
  6. implemented author image in thread and and posts views

burgerphilic18 and others added 16 commits December 12, 2025 21:38
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
…eation

Merge remote-tracking branch 'spandan/ui-revamp' into thread-post-creation
wq
.
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: amanraj <raj.aman4001@gmail.com>
Signed-off-by: sam28u <sambhufirst11@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @sam28u, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application's data fetching capabilities, particularly for user profiles and forum content. It integrates Google authentication images, provides dynamic updates for various statistics, and displays user-specific threads on profile pages. Additionally, it introduces a suite of new UI components and a refreshed neo-brutalism design, improving the overall user experience and visual consistency.

Highlights

  • Enhanced Data Fetching: Implemented comprehensive data fetching mechanisms across the application, particularly for user profiles and forum content.
  • Google Auth Image Integration: Users' Google authentication images are now fetched and displayed on their profile pages.
  • Dynamic Stats Updates: Forum statistics and user-specific stats are now dynamically updated based on database values.
  • Profile Page Thread Display: User-specific threads are now fetched and displayed on the /profile/username page.
  • Homepage Thread Count: The count of threads under each topic is now fetched and displayed on the homepage.
  • New UI Components & Styling: Introduced several new UI components for forum interactions (e.g., CategoryTile, PostItem, ReplyBox, ThreadRow) and refactored styling to a neo-brutalism theme with customizable color palettes.
  • API Route Restructuring: All backend API routes have been consistently prefixed with /api for better organization and clarity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant new functionality for data fetching related to threads, posts, users, and stats, alongside a major UI overhaul with new components and a new theming system. The backend changes are generally solid, featuring new endpoints and more efficient queries. However, I've identified a potential issue in a database migration that could fail on existing data. On the frontend, the refactoring is extensive with many new components and pages, and the new api.ts for centralizing API calls is a great improvement. I did find an N+1 query problem on the home page that could affect performance. Overall, this is a substantial pull request, and addressing the noted issues will enhance its robustness and performance.

Comment on lines +7 to +8
ALTER TABLE "thread" ALTER COLUMN "view_count" SET DEFAULT 0;--> statement-breakpoint
ALTER TABLE "thread" ALTER COLUMN "view_count" SET NOT NULL;--> statement-breakpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The statement ALTER TABLE "thread" ALTER COLUMN "view_count" SET NOT NULL; on line 8 could fail if there are any existing rows in the thread table where view_count is NULL. The SET DEFAULT 0 on line 7 only applies to new rows, not existing ones. To make this migration safer, you should first update existing NULL values to 0 before applying the NOT NULL constraint.

Comment on lines +30 to +42
const topicsWithCounts = await Promise.all(
topRes.data.map(async (topic: Topic) => {
try {
const threadRes = await api.getThreadsByTopic(topic.id, 1, 1, "latest");
return {
...topic,
threadCount: threadRes.pagination.count
};
} catch {
return { ...topic, threadCount: 0 };
}
})
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This logic for fetching topics and then their thread counts inside a Promise.all(topRes.data.map(...)) loop creates an N+1 query problem. For every topic, a separate database query is made to get the thread count. If there are many topics, this will lead to poor performance. It would be more efficient to have the backend return the thread count along with the topics in a single query, for example by using a subquery or a join with aggregation.

Comment thread apps/server/src/routers/threads.ts Outdated
END
`.as('authorName'),

replies: sql<number>`GREATEST(COUNT(${postsTable.id}) - 0, 0)`.as('replies'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The - 0 in this SQL expression is redundant and makes the code harder to understand. COUNT(${postsTable.id}) already returns a number. If the goal is to ensure the result is non-negative, GREATEST(COUNT(${postsTable.id}), 0) is sufficient. This could be simplified for better readability.

Suggested change
replies: sql<number>`GREATEST(COUNT(${postsTable.id}) - 0, 0)`.as('replies'),
replies: sql<number>`GREATEST(COUNT(${postsTable.id}), 0)`.as('replies'),

@iamanishx

iamanishx commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

apps/server/src/db/migrations/0002_charming_maginty.sql

@sam28u asking ai to make changes in migration files is diabolical . Then whats the point of having a ORM if you can ask ai to make migration files edits ?

@sam28u

sam28u commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

@iamanishx I was facing an issue so I took help of ai, and then I didn't notice (my bad) migration file has been created.
Update and push soon!!!

@iamanishx

Copy link
Copy Markdown
Contributor

@sam28u its better to ping on discord abt the issue right ? Did you? nah

@sam28u

sam28u commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

@iamanishx sorry bout that!!! I thought it was my code issue , Will update my pr soon.

@iamanishx

Copy link
Copy Markdown
Contributor

@sam28u whats the use of tenstack query in this ? I show pkg.json had this

@iamanishx

Copy link
Copy Markdown
Contributor

image
Nah don't make it security vulnerable codebase

@iamanishx iamanishx changed the title Thread post creation feat: implementation whole application architecture Jan 13, 2026
@iamanishx iamanishx changed the title feat: implementation whole application architecture feat: implementation of whole application architecture Jan 13, 2026
@sam28u

sam28u commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

@consoledotaman pr had this I didn't include that , I've been using his pr > @sam28u whats the use of tenstack query in this ? I show pkg.json had this

@iamanishx

Copy link
Copy Markdown
Contributor

apps/server/src/routers/threads.ts

const withSearch = (search && search.trim())
    ? selectQuery.where(ilike(threadsTable.threadTitle, `%${search.trim()}%`))
    : selectQuery;

please dont expose the db for sql injection

use this Drizzler's like or whatever your choice but not the above one
.where(like(threadsTable.threadTitle, sql%${search.trim()}%))

@iamanishx

Copy link
Copy Markdown
Contributor

other looks good tho make changes for this will merge the PR and deploy it soon lfg

@iamanishx

Copy link
Copy Markdown
Contributor

@sam28u @burgerphilic18 follow up ?

@iamanishx

Copy link
Copy Markdown
Contributor
image have a look guys

Co-authored-by: Friend Name <manishbiswal754@gmail.com>
@iamanishx
iamanishx force-pushed the thread-post-creation branch from 4aa1545 to 4ede538 Compare March 1, 2026 13:19
@iamanishx
iamanishx merged commit 8445ab0 into p-society:main Mar 1, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants