summaryrefslogtreecommitdiff
path: root/GEMINI.md
blob: a07b039dca533b1386872c7acf8142909eabe8e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Gemini Collaboration Plan for bs5

Hello! Based on my analysis of your project structure, this appears to be an OCaml-based web application with a server-side rendering approach, likely inspired by React Server Components. The backend is built with OCaml and the Dune build system, using Nix for environment management. The frontend uses Tailwind CSS.

The assets and file structure (`soyjaks/`, `board/`, `BlogIndex.mlx`) strongly suggest the goal is to build a modern, feature-rich imageboard or forum with a blog.

Here is a potential roadmap with ideas for enhancing the application. We can tackle these in any order you prefer.

## High-Level Goals

1.  **Full-Featured Imageboard:** Implement core features like user-creatable boards, threads, and posts with image uploads.
2.  **User System:** Add user authentication, profiles, and roles.
3.  **Modern UX:** Create a polished, responsive, and interactive user experience.
4.  **Robust Backend:** Ensure the backend is scalable, testable, and easy to maintain.

---

## Proposed Development Areas

### 1. Backend & Core Logic

-   **[ ] Database Schema Expansion:**
    -   Define and create tables for `users`, `sessions`, `boards`, `threads`, and `posts` in `init.sql`.
    -   Design relationships (e.g., one-to-many for boards to threads, threads to posts).
-   **[ ] User Authentication:**
    -   Implement registration and login handlers.
    -   Manage user sessions (e.g., using signed cookies).
    -   Add middleware to protect certain routes.
-   **[ ] Posting Engine:**
    -   Create handlers in `post_handlers.ml` for creating new threads and replying to existing ones.
    -   Implement logic for handling image uploads, including validation (file type, size) and storage.
-   **[ ] API Development:**
    -   Consider creating a basic JSON API for fetching board/thread data, which could be used for dynamic frontend updates.
-   **[ ] Refine Querying:**
    -   Expand `lib/shared/query.ml` to include functions for all database interactions (e.g., `get_user_by_username`, `get_posts_for_thread`).

### 2. Frontend & UI Components

-   **[ ] Component-Based UI:**
    -   The `lib/pages/components/` directory is a great start. Let's break down the UI into smaller, reusable server-side components.
    -   **Potential Components:** `BoardHeader.mlx`, `Thread.mlx`, `Post.mlx`, `ReplyForm.mlx`, `Navbar.mlx`.
-   **[ ] Board Index Page:**
    -   Create a page that lists all available boards, perhaps with descriptions and post counts.
-   **[ ] Thread View:**
    -   Develop the view for a single thread, displaying all its posts.
-   **[ ] UI/UX Polish:**
    -   Improve image viewing (e.g., a lightbox/modal for viewing full-size images).
    -   Implement "quick reply" forms.
    -   Use HTMX or a small amount of JavaScript for dynamic updates without full page reloads (e.g., for posting replies).

### 3. Testing & DX (Developer Experience)

-   **[ ] Expand Test Suite:**
    -   Add unit tests for new handlers and database queries in `test/`.
    -   Write integration tests for common user flows (e.g., registering, posting a thread).
-   **[ ] Configuration:**
    -   Move hardcoded values (like database paths or secret keys) into a configuration file or environment variables (`.env`).
-   **[ ] Asset Pipeline:**
    -   Optimize the `tailwind.sh` script for production builds (e.g., purging unused CSS).

---

Let me know what you think of this plan and which area you'd like to start with!