Skip to content

Commit 6a25fa0

Browse files
Add comprehensive documentation
- Create CONTRIBUTING.md with development guidelines - Create CHANGELOG.md with version history - Create ARCHITECTURE.md explaining module structure - Update MIGRATION.md to reflect actual changes - Document AngularJS modules, WebSocket protocol, and build system
1 parent ee6f5ac commit 6a25fa0

3 files changed

Lines changed: 272 additions & 0 deletions

File tree

ARCHITECTURE.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# RingID Architecture
2+
3+
## Overview
4+
5+
RingID is a real-time social networking application built with AngularJS 1.x. It uses WebSocket for real-time communication and follows a modular monorepo structure.
6+
7+
## Monorepo Structure
8+
9+
```
10+
dump-data/
11+
├── apps/
12+
│ └── main-app/ # Main AngularJS application
13+
│ ├── app/ # Application code
14+
│ │ ├── chat/ # Chat module
15+
│ │ ├── feed/ # News feed module
16+
│ │ ├── profile/ # User profile module
17+
│ │ ├── auth/ # Authentication
18+
│ │ ├── circle/ # Friend circles
19+
│ │ ├── common/ # Shared components
20+
│ │ ├── friend/ # Friend management
21+
│ │ ├── global/ # Global services
22+
│ │ ├── header/ # Header/navigation
23+
│ │ ├── media/ # Media handling
24+
│ │ ├── notification/ # Notifications
25+
│ │ ├── shared/ # Shared directives
26+
│ │ ├── sticker/ # Sticker pack
27+
│ │ └── utils/ # Utilities
28+
│ └── images/ # Application images
29+
├── packages/
30+
│ ├── scripts/ # Shared JavaScript utilities
31+
│ ├── styles/ # Shared CSS styles
32+
│ ├── templates/ # Shared HTML templates
33+
│ ├── common/ # Common resources
34+
│ └── resources/ # Shared resources
35+
├── config/ # Server configurations
36+
├── tests/ # Test files
37+
└── scripts/ # Migration scripts
38+
```
39+
40+
## AngularJS Module Structure
41+
42+
### Core Modules
43+
- `ringid` — Main application module
44+
- `ringid.chat` — Chat functionality
45+
- `ringid.feed` — News feed
46+
- `ringid.profile` — User profiles
47+
- `ringid.auth` — Authentication
48+
- `ringid.circle` — Friend circles
49+
- `ringid.friend` — Friend management
50+
- `ringid.notification` — Notifications
51+
- `ringid.media` — Media handling
52+
- `ringid.sticker` — Stickers
53+
- `ringid.newsportal` — News portal
54+
55+
### Module Registration Pattern
56+
57+
Modules use a try/catch pattern for registration:
58+
59+
```javascript
60+
try {
61+
angular.module('ringid.feed');
62+
} catch (e) {
63+
angular.module('ringid.feed', [
64+
'ringid.services',
65+
'ngRoute',
66+
// dependencies
67+
]);
68+
}
69+
```
70+
71+
## WebSocket Communication
72+
73+
Real-time communication uses a custom binary protocol:
74+
75+
- **worker.js** — Main WebSocket handler
76+
- **sender.js** — Message sending utilities
77+
- **wat.fall.js** — Fallback handling
78+
79+
### Message Types (OPERATION_TYPES)
80+
81+
Defined in `packages/scripts/operationtypes.js`:
82+
- `ACTION_ADD` — Add new item
83+
- `ACTION_UPDATE` — Update existing item
84+
- `ACTION_DELETE` — Delete item
85+
- `ACTION_GET` — Retrieve data
86+
- `ACTION_LIST` — List items
87+
88+
## Services and Factories
89+
90+
### Core Services
91+
- `AuthService` — Authentication and session management
92+
- `ChatService` — Chat message handling
93+
- `FeedService` — News feed operations
94+
- `UserService` — User data management
95+
- `NotificationService` — Notification handling
96+
- `MediaService` — Media upload and processing
97+
98+
### Shared Services (packages/scripts/)
99+
- `ringalert.factory.js` — Alert notifications
100+
- `ringapicall.factory.js` — API calls
101+
- `utils.factory.js` — Utility functions
102+
103+
## Template System
104+
105+
Templates are stored in `packages/templates/` and referenced using the `@templates/` alias:
106+
107+
```javascript
108+
// In directives
109+
templateUrl: '@templates/dropdowns/action-dropdown.html'
110+
111+
// In controllers
112+
$scope.templateUrl = '@templates/popups/create-album-popup.html'
113+
```
114+
115+
Vite resolves the `@templates` alias to `packages/templates/`.
116+
117+
## Build System
118+
119+
### Development
120+
- Command: `pnpm start`
121+
- Tool: Vite with HMR
122+
- Port: 8080
123+
- Proxy: API requests to `localhost:3000`
124+
125+
### Production
126+
- Command: `pnpm build`
127+
- Output: `dist/`
128+
- Tool: Vite with Rollup bundler
129+
130+
## Environment Configuration
131+
132+
Environment variables (Vite):
133+
- `VITE_API_URL` — Backend API URL
134+
- `VITE_WS_URL` — WebSocket URL
135+
- `VITE_DEBUG` — Debug mode flag
136+
137+
See `.env.example` for configuration options.
138+
139+
## Testing
140+
141+
- Test runner: Karma
142+
- Framework: Jasmine
143+
- E2E: Playwright (configured but not implemented)
144+
145+
Run tests: `pnpm test`
146+
147+
## Security Considerations
148+
149+
- AngularJS 1.x has known XSS vulnerabilities
150+
- Bootstrap 3.x has XSS in Popover/Tooltip
151+
- Plan migration to modern framework (Angular/React/Vue)
152+
- Implement strict CSP headers
153+
- Sanitize user input

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Changelog
2+
3+
All notable changes to the RingID project will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
### Added
8+
- Pre-commit hooks with Husky and lint-staged
9+
- GitHub Actions CI/CD pipeline
10+
- ESLint and Prettier configuration
11+
- Vite build system with HMR
12+
13+
### Changed
14+
- Migrated from Bower to pnpm
15+
- Replaced Grunt with Vite
16+
- Consolidated templates into packages/templates
17+
- Updated template URLs to use @templates alias
18+
- Removed legacy backup files
19+
20+
### Removed
21+
- Bower configuration (bower.json, .bowerrc)
22+
- Grunt configuration (Gruntfile.js)
23+
- Legacy linter configs (.jshintrc, .tern-project)
24+
- Old backup files (*_old*, *_backup*)
25+
26+
## [0.2.0] - 2026-05-01
27+
28+
### Added
29+
- pnpm workspace configuration
30+
- Modern build tooling with Vite
31+
- ESLint with AngularJS support
32+
- Prettier for code formatting
33+
- .env.example for environment configuration
34+
- .nvmrc for Node.js version management
35+
36+
### Changed
37+
- Migrated from npm to pnpm
38+
- Flattened nested package directories
39+
- Updated all package.json files with proper metadata
40+
- Improved README with pnpm commands
41+
42+
### Removed
43+
- Grunt build system
44+
- Bower dependency management
45+
- Legacy build artifacts
46+
47+
## [0.1.0] - 2024-01-01
48+
49+
### Added
50+
- Initial monorepo structure
51+
- AngularJS 1.3.15 application
52+
- Basic chat, feed, and profile functionality
53+
- WebSocket communication
54+
55+
[Unreleased]: https://github.com/threatcode/dump-data/compare/v0.2.0...HEAD
56+
[0.2.0]: https://github.com/threatcode/dump-data/compare/v0.1.0...v0.2.0
57+
[0.1.0]: https://github.com/threatcode/dump-data/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing to RingID
2+
3+
Thank you for your interest in contributing to RingID!
4+
5+
## Development Setup
6+
7+
1. Fork the repository
8+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/dump-data.git`
9+
3. Install dependencies: `pnpm install`
10+
4. Start development server: `pnpm start`
11+
12+
## Branch Naming
13+
14+
- `feature/description` — New features
15+
- `fix/description` — Bug fixes
16+
- `refactor/description` — Code refactoring
17+
- `docs/description` — Documentation updates
18+
- `chore/description` — Maintenance tasks
19+
20+
## Commit Conventions
21+
22+
We follow Conventional Commits:
23+
24+
```
25+
<type>(<scope>): <description>
26+
27+
[optional body]
28+
29+
[optional footer]
30+
```
31+
32+
Types: `feat`, `fix`, `refactor`, `docs`, `style`, `test`, `chore`
33+
34+
Examples:
35+
- `feat(chat): add message reactions`
36+
- `fix(auth): resolve login redirect issue`
37+
- `refactor(feed): consolidate feed controllers`
38+
39+
## Pull Request Process
40+
41+
1. Create a PR against the `main` branch
42+
2. Fill out the PR template completely
43+
3. Ensure CI checks pass
44+
4. Request review from maintainers
45+
5. Address review feedback
46+
47+
## Code Quality
48+
49+
- Run `pnpm lint` before committing
50+
- Run `pnpm format` to format code
51+
- Write tests for new features
52+
- Update documentation as needed
53+
54+
## Testing
55+
56+
- Run `pnpm test` to execute tests
57+
- Add tests for new functionality
58+
- Ensure existing tests pass
59+
60+
## Questions?
61+
62+
Open an issue or contact the maintainers.

0 commit comments

Comments
 (0)