Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8a9a31d
feat: prepare app UI foundation and update gitignore
bohdanvenhrenovych Jan 18, 2026
fd6d128
chore: remove .vite folder from git tracking
bohdanvenhrenovych Jan 18, 2026
c64520b
added generic form and textarea field, create message panel component
Jan 25, 2026
1d10ced
Merge pull request #1 from bohdanvenhrenovych/feat/generic-form-and-m…
Jan 25, 2026
43c4ac3
feat: add feeds, chats, folders links for the sidebar
Jan 25, 2026
03398c5
fix audit issue, merge conflicts
Jan 25, 2026
f930851
added shadcn, adjusted theme, fixed gaps
Jan 31, 2026
3c035aa
feat: add feeds, update Typo component, add emojies
bohdanvenhrenovych Feb 1, 2026
938e606
Merge pull request #2 from bohdanvenhrenovych/feat/add-shadcn
bohdanvenhrenovych Feb 1, 2026
8ef6363
added chat timeline
Feb 1, 2026
136b151
refactor: resolve conflicts, refactor
bohdanvenhrenovych Feb 1, 2026
8514554
refactor: extract feeds to the seperate component
bohdanvenhrenovych Feb 1, 2026
5ab0437
Merge branch 'feat/init-app' into feat/add-chat-timiline
Feb 1, 2026
381c92c
Merge pull request #3 from bohdanvenhrenovych/feat/add-chat-timiline
bohdanvenhrenovych Feb 1, 2026
021918f
refactor: use shared buttons
bohdanvenhrenovych Feb 1, 2026
d75fb10
update: add auto-scroll, remove default styles for scrollbar in the c…
bohdanvenhrenovych Feb 1, 2026
d0206f8
added sections to the right sidebar
anastasiia-matushenko Feb 1, 2026
f52edd7
added new section, updated structure
anastasiia-matushenko Feb 7, 2026
f02f319
Merge pull request #4 from bohdanvenhrenovych/feat/right-sidebar
bohdanvenhrenovych Feb 7, 2026
77ef7b7
feat: add header
bohdanvenhrenovych Feb 8, 2026
9d37e12
fix(chat): single source of truth for messages and reaction handling
bohdanvenhrenovych Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
- You are an expert in TypeScript, App Router, React, Shadcn UI, and Tailwind and Framer Motion.

- Code Style and Structure

- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Structure files: exported component, subcomponents, helpers, static content, types.

- Naming Conventions

- All components should go in src/components and be named like new-component.tsx
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.

- TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.

- Syntax and Formatting

- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.

- UI and Styling

- Use Tailwind for components and styling.
- Implement responsive design with Tailwind CSS

- Performance Optimization

- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC).
- Wrap client components in Suspense with fallback.
- Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, implement lazy loading.

- Key Conventions

- Limit 'use client':
- Use only for Web API access in small components.
- Avoid for data fetching or state management.
- Place both the /app and /components folders under a /src directory. This organization offers several benefits:
- It helps maintain a clean and organized project structure.
- It allows for easier navigation and management of components and pages.
- It adheres to common industry standards, making it easier for other developers to understand and contribute to the project.
- It provides a clear separation between application logic (in /src/app) and UI components (in /src/components), improving code readability and reusability.
- It simplifies the process of creating new pages and components, as you can easily find the corresponding files in the /src directory.
- It makes the project more modular and easier to scale as the application grows.
- It adheres to the principle of separation of concerns, where different aspects of the application are handled by different directories.

## Components Organization

Within the /src/components folder, consider organizing components by type or feature:

By Type: Group components like forms, buttons, layout elements, etc.

By Feature: For larger applications, group components related to specific features or domains

For example:

/src/components
├── /ui
│ ├── /Button
│ ├── /Modal
│ └── /Card
└── /layout
├── /Navbar
└── /Footer

- Private Components: For components used only within specific pages, you can create a _components folder within the relevant /app subdirectory.

- Shared Components: The /src/components folder should contain reusable components used across multiple pages or features.

- Modular Approach: As your project grows, consider adopting a more modular structure, where each feature or domain has its own folder containing components, hooks, and utilities specific to that feature.

- Don't right redunt comments

- Use our custom taiwind variables
45 changes: 45 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'node_modules', 'build', '*.config.*'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json'],
ecmaFeatures: {
jsx: true,
},
},
plugins: ['react-refresh', '@typescript-eslint', 'react', 'react-hooks'],
settings: {
react: {
version: 'detect',
},
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
},
}
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Dependencies
node_modules

# Build outputs
dist
*.tsbuildinfo

# Environment variables
.env
.env*.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage
*.lcov

# Logs
logs
*.log
npm-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Thumbs.db

# OS files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Desktop.ini

# Temporary files
*.tmp
*.temp
*.swp
*.swo
*~
.cache

# Vite
.vite

.output
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{js,jsx,json,css,md}": ["prettier --write"]
}
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
dist
build
.next
.nuxt
.cache
coverage
*.min.js
*.min.css
package-lock.json
yarn.lock
pnpm-lock.yaml
.vercel
.turbo
storybook-static
routeTree.gen.ts
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 80,
"arrowParens": "avoid",
"endOfLine": "lf",
"useTabs": false
}
73 changes: 71 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
# xxii-react
XXII React Client
# XXII Chat Frontend

A terminal-style chat application built with Vite, React 19, and TypeScript. Features a local-first architecture with offline support using IndexedDB.

## Features

- 🖥️ Terminal-inspired UI with monospace fonts and minimalist design
- 💬 Real-time chat with message threading
- 📰 Feed system for posts and updates
- 📁 File attachments and folder organization
- 🔍 Full-text search across messages, posts, and files
- ⌨️ Keyboard-first navigation
- 💾 Local-first architecture with offline support
- 🔄 Optimistic updates with background sync

## Tech Stack

- **Build Tool**: Vite 7+
- **Framework**: React 19
- **Language**: TypeScript 5.7+
- **Router**: React Router v7
- **State Management**: TanStack Query
- **UI**: Tailwind CSS 4
- **Storage**: IndexedDB (via idb)

## Getting Started

```bash
# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

# Run tests
npm run test
```

The app will be available at [http://localhost:3000](http://localhost:3000)

## Project Structure

```
src/
├── components/ # Reusable React components
├── routes/ # Route components
├── lib/ # Utilities and helpers
├── styles/ # Global styles and CSS
├── router.tsx # React Router configuration
└── main.tsx # Application entry point
```

## Scripts

- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm run preview` - Preview production build
- `npm run test` - Run tests
- `npm run lint` - Lint code
- `npm run format` - Format code

## Learn More

- [React](https://react.dev/)
- [React Router](https://reactrouter.com/)
- [TanStack Query](https://tanstack.com/query)
- [Vite](https://vitejs.dev/)
- [Tailwind CSS](https://tailwindcss.com/)
25 changes: 25 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "radix-lyra",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"menuColor": "default",
"menuAccent": "subtle",
"registries": {}
}
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XXII Chat</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading