Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Production CI/CD Pipeline

on:
push:
branches: [ "main", "feature/*" ]
pull_request:
branches: [ "main" ]

jobs:
security-audit:
name: Cybersecurity SAST & Vulnerability Audit
runs-on: ubuntu-latest
steps:
- name: Checkout Codebase
uses: actions/checkout@v4

- name: Setup Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: true

- name: Install Vulnerability & Security Scanner Tools
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest

- name: Audit Bubbletea Dependencies
run: |
cd bubbletea
govulncheck ./...

- name: Audit Tview Dependencies
run: |
cd tview
govulncheck ./...

- name: Scan Bubbletea Code for Vulnerabilities (gosec)
run: |
cd bubbletea
# Exclude test files from security scan
gosec -exclude-dir=tests ./...

- name: Scan Tview Code for Vulnerabilities (gosec)
run: |
cd tview
gosec ./...

build-and-test:
name: Cross-Platform Build & Verification
needs: security-audit
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
module: [ bubbletea, tview ]
steps:
- name: Checkout Codebase
uses: actions/checkout@v4

- name: Setup Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: true

- name: Install Dependencies
run: |
cd ${{ matrix.module }}
go mod tidy

- name: Verify Formatting (gofmt)
if: matrix.os == 'ubuntu-latest'
run: |
cd ${{ matrix.module }}
diff -u <(echo -n) <(gofmt -d .)

- name: Run Static Analysis (go vet)
run: |
cd ${{ matrix.module }}
go vet ./...

- name: Execute Test Suite
run: |
cd ${{ matrix.module }}
go test -v -race ./...

- name: Test Build compilation
run: |
cd ${{ matrix.module }}
go build -v -o ropa-sci-test-build ./...
32 changes: 0 additions & 32 deletions .github/workflows/go.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Binaries and executables
*.exe
*.exe~
*.dll
*.so
*.dylib
bin/
tview/tview
tview/ahmedtoyyib1
tview/tmp/

# Logs
*.log
logs/
bubbletea/logs/
app.log

# OS generated files
.DS_Store
Thumbs.db
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ropa-Sci Group Project License

Copyright (c) 2026 Jezreal Momoh, Ahmed Toyyib, and Ropa-Sci Project Contributors.
All rights reserved.

## 1. Permission to View and Use
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to view, inspect, study, and run the Software for personal, educational, or evaluation purposes.

## 2. Restrictions on Alteration and Redistribution
- You **may not** modify, alter, transform, or build upon the Software for the purpose of distributing modified versions as your own work.
- You **may not** claim sole ownership, authorship, or patent rights over the Software.
- You **must** retain all original copyright notices, contributor credits, and this license text in all copies or substantial portions of the Software.

## 3. Contributions and Collaborative Development
- Contributions (e.g., bug fixes, code optimizations, extensions) are welcome and encouraged via official repository pull requests or merge requests.
- By submitting a contribution to the Software, you agree to license your contribution under this same license, and acknowledge that the original authorship and copyright of the collective project remains with the Ropa-Sci Group Project and its contributors.

## 4. No Warranty
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
67 changes: 44 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
# 🎮 Ropa-Sci

> Multiplayer Rock-Paper-Scissors CLI game in Go

## Tech Stack
- Go + Bubbletea + Lipgloss
- WebSocket multiplayer
- ASCII art UI

## Roadmap

| Week | Focus | Your Role |
|------|-------|-----------|
| 1 | Setup + team alignment | Consulted |
| 2 | Main menu screen | ★ Responsible |
| 3 | ASCII art + game screen | ★ Responsible |
| 4 | Single-player mode | ★ Responsible |
| 5 | Multiplayer UI (WebSocket) | ★ Responsible |
| 6 | Integration testing | Consulted |
| 7 | Bug fixes + polish | Responsible |
| 8 | Docs + release | Accountable |

## How to Run
\```bash
> A modern, multiplayer Rock-Paper-Scissors CLI gaming platform built in Go.

Ropa-Sci is designed as a collaborative, group-built terminal game featuring beautiful console-grade visuals, smart game-theory opponent predictive models, peer-to-peer LAN multiplayer rooms, and role-based admin controls.

---

## 🛠️ Tech Stack & Key Technologies
- **Language:** Go (Golang)
- **TUI Frameworks:** [Bubble Tea](https://github.com/charmbracelet/bubbletea), [Lip Gloss](https://github.com/charmbracelet/lipgloss), and `tview`
- **Networking:** P2P Local WebSockets
- **Architecture:** Thread-safe JSON state store

---

## 📂 Project Architecture

The project is split into two primary CLI client engines:

- **[`bubbletea/`](./bubbletea/README.md):** Features a customized floating-frame cyber-neon interface, Braille animations, predictive game-theory Markov Chain AI, local network multiplayer matchmaking, and a multi-level role-based admin dashboard.
- **`tview/`:** Contains alternative form inputs and navigation panels.

---

## 🚀 How to Run

### Run the Bubble Tea Client
Navigate to the `bubbletea` folder and run:
```bash
cd bubbletea
go run cmd/main.go
\```
```

### Run Unit Tests
To run structural tests across models, state validation, and storage:
```bash
cd bubbletea
go test ./...
```

---

## 🛡️ License, Contribution & Security
- **License:** Distributed under our custom collaborative [LICENSE](./LICENSE). The code is open to view and you may contribute pull requests, but modifications may not be distributed separately or claimed under different ownership to preserve the rights of all group contributors.
- **Security Policy:** Review our vulnerability reporting guidelines and data handling rules in the [SECURITY.md](./SECURITY.md) document.
- **Developer Walkthrough:** For details on execution flow, MVU state machine, and subsystems, check out [bubbletea/walkthrough.md](./bubbletea/walkthrough.md).
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Security Policy

## Supported Versions

We support security updates for the following versions:

| Version | Supported |
|---------|-----------|
| 1.x.x | Yes |
| < 1.0 | No |

## Reporting a Vulnerability

If you discover a security vulnerability within this project, please do not open a public issue. Instead, report it directly by contacting the project maintainers:

- Email: `jezrealglobal@gmail.com`

We will acknowledge your report within 48 hours and work with you to analyze and resolve the issue.

## Local Data Security

Ropa-Sci stores all profile data locally in `data/players.json`.
- **Encryption:** The data is stored in plain-text JSON format. It is recommended to secure the filesystem of the host machine to prevent unauthorized local access.
- **Input Sanitization:** Usernames, names, and game moves are sanitized and validated to prevent injection or terminal escape sequence manipulation.
- **Concurrency Security:** File read/write operations on the JSON database are thread-safe and protected by a read-write sync mutex.
58 changes: 58 additions & 0 deletions bubbletea/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Ropa-Sci Bubbletea TUI Engine

This subdirectory contains the Bubbletea terminal user interface (TUI) implementation of **Ropa-Sci** — a modern, cyber-neon styled Rock-Paper-Scissors game with game-theory AI, local multiplayer, and administration tools.

## Tech Stack
- **Go** (Golang)
- **Bubble Tea** (TUI framework)
- **Lip Gloss** (Terminal styling and layout)
- **Gorilla WebSocket** (Local P2P Multiplayer connection)

---

## Directory Structure

- `cmd/main.go`: Application entry point, central update event loop, and screen renderers.
- `models/`: Code relating to game logic, players database, validation, AI models, and logging.
- `ai_engine.go`: Game-theory based predictor using Markov Chain algorithms.
- `logger.go`: Configured structured log system outputting to `logs/app.log`.
- `player.go`: Definitions for player structures, game phases, and state layers.
- `storage.go`: Local JSON-based persistent database with thread-safe mutex locks.
- `server/`: WebSocket service code facilitating local network peer-to-peer multiplayer.
- `ui/`: CSS-like Lipgloss styles, neon colors definitions, and layout configurations.
- `data/players.json`: Plain-text file storing local player accounts and lifetime statistics.

---

## Features

### 1. Cyber-Neon Layout & UI
Overhauled in 2026 using responsive double-bordered card styling, interactive lists, and `lipgloss.Place` vertical/horizontal centering for a premium, console-grade desktop feel.

### 2. Local P2P Multiplayer
Allows players on the same local area network (LAN) to host or join match rooms. Connections are brokered over WebSockets with zero dependency on third-party cloud infrastructure.

### 3. Smart Predictor AI
Includes a predictive Markov Chain AI engine that analyzes player move histories during matches to predict future selections, making the single-player experience highly engaging.

### 4. Admin Dashboard
Privileged accounts (e.g. `jmomoh`) route to the Admin Panel upon signing in. Admins can view scrollable lists of registered accounts, toggle roles, reset stats, and delete player data.

---

## Getting Started

### Prerequisites
Make sure you have Go installed on your machine (v1.20+ recommended).

### Running the App
From the `bubbletea` directory, execute:
```bash
go run cmd/main.go
```

### Running Tests
Execute unit tests for database and validation logic:
```bash
go test ./...
```
Loading
Loading