Skip to content

ralongit/projects

Repository files navigation

SpikeCam

A modern, secure camera system featuring real-time recording, device management, and cloud integration. Built with Go backend services and Android mobile application.

🚀 Quick Start

For Users

  1. Download the latest APK from Releases
  2. Install on your Android device (API 24+)
  3. Configure your backend server URL
  4. Start recording or viewing devices

For Developers

  1. Clone: git clone [repository-url]
  2. Backend: cd SpikeCam/spike-cam-backend && go run ./cmd/spikecam
  3. Mobile: Open SpikeCam/spike-cam-mobile-app in Android Studio
  4. CI & Release: Use unified scripts in ./scripts/ (called by .github/workflows/ci.yml and release.yml)

📱 System Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  Android App    │    │   Go Backend    │    │ Infrastructure  │
│  (Kotlin)       │◄──►│   (REST API)    │◄──►│  (PostgreSQL)   │
│                 │    │                 │    │                 │
│ • Recording     │    │ • JWT Auth      │    │ • Systemd       │
│ • Viewing       │    │ • Device Mgmt   │    │ • TLS/HTTPS     │
│ • Device Mgmt   │    │ • Event Storage │    │ • Auto-deploy   │
│ • OAuth Login   │    │ • WebSocket     │    │ • Monitoring    │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🏗️ Project Structure

SpikeCam/
├── spike-cam-backend/           # Go REST API server
│   ├── cmd/spikecam/           # Application entry point
│   ├── internal/               # Private business logic
│   │   ├── auth/               # JWT & OAuth authentication
│   │   ├── handlers/           # HTTP request handlers
│   │   ├── models/             # Database models
│   │   ├── server/             # WebSocket server
│   │   └── shared/             # Common protocols
│   ├── docs/                   # Swagger API documentation
│   └── scripts/                # Deployment & testing
│
├── spike-cam-mobile-app/        # Android application
│   ├── app/src/main/java/       # Kotlin source code
│   ├── app/src/main/res/        # UI resources & layouts
│   └── documentation/          # Mobile app documentation
│
├── spike-cam-infrastructure/    # Deployment configs
├── scripts/                     # Build & release automation
├── releases/                    # Published APK files
└── documentation/              # Project-wide documentation

✨ Features

🎥 Recording & Viewing

  • Real-time camera recording with motion detection
  • Live streaming between devices via WebSocket
  • Event storage with timestamp and metadata
  • Multi-device support (recorder/viewer roles)

🔐 Security & Authentication

  • JWT-based authentication with refresh tokens
  • Google OAuth integration for seamless sign-in
  • TLS/HTTPS support for production deployments
  • Encrypted local storage on mobile devices

🛠️ Management & Monitoring

  • Device registration and status tracking
  • Health monitoring with built-in diagnostics
  • Auto-deployment scripts for EC2 and local servers
  • Comprehensive logging and error handling

📱 Mobile Experience

  • Material Design 3 with modern UI/UX
  • Background recording service
  • Real-time notifications and status updates
  • Offline capability with local event storage

🔧 Technology Stack

Backend (Go)

  • Framework: Native Go with Gorilla WebSocket
  • Database: SQLite (dev) / PostgreSQL (prod)
  • Authentication: JWT with Google OAuth
  • Documentation: Swagger/OpenAPI
  • Deployment: Systemd service on Linux

Mobile (Android)

  • Language: Kotlin with Architecture Components
  • UI: Material Design 3 with ViewBinding
  • Architecture: MVVM pattern
  • Storage: Room database with encrypted preferences
  • Networking: OkHttp with authenticated requests

Infrastructure

  • Cloud: AWS EC2 with automated deployment
  • Database: PostgreSQL with auto-migration
  • Security: TLS certificates and secure key management
  • Monitoring: Health checks and service monitoring

📋 System Requirements

Backend Server

  • OS: Linux (Ubuntu 20.04+ recommended)
  • Runtime: Go 1.21+
  • Database: PostgreSQL 12+ (production)
  • Memory: 512MB minimum, 2GB recommended
  • Storage: 1GB minimum for logs and database

Mobile App

  • Android: 7.0 (API 24) or higher
  • RAM: 2GB minimum, 4GB recommended
  • Storage: 100MB free space
  • Camera: Required for recorder mode
  • Network: WiFi or mobile data

🚀 Deployment

Quick Deployment

# Clone repository
git clone [repository-url]
cd SpikeCam

# Set up environment
cp scripts/.env.example scripts/.env
# Edit scripts/.env with your configuration

# CI (locally)
bash ./scripts/ci-backend.sh
bash ./scripts/ci-mobile.sh

# Release builds (locally)
bash ./scripts/release-backend.sh
bash ./scripts/release-apk.sh

Manual Setup

  1. Backend: See Backend README
  2. Mobile: See Mobile App README
  3. Infrastructure: Check deployment scripts

📚 Documentation

Getting Started

Component-Specific

Integration & Setup

🤝 Contributing

Development Setup

  1. Prerequisites: Go 1.21+, Android Studio, PostgreSQL
  2. Clone: git clone [repository-url]
  3. Backend: cd SpikeCam/spike-cam-backend && go mod download
  4. Mobile: Open Android project in Android Studio
  5. Test: Run ./scripts/test_project_flow.sh

Code Standards

  • Go: Use go fmt, go vet, and golangci-lint
  • Kotlin: Follow Android/Kotlin style guide
  • Testing: Maintain >80% coverage
  • Documentation: Update docs with any API changes

Contribution Workflow

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Make changes and add tests
  4. Commit: git commit -m 'feat: add amazing feature'
  5. Push: git push origin feature/amazing-feature
  6. Open Pull Request

📄 License

This project is licensed under the MIT License. See LICENSE file for details.

🆘 Support

Getting Help

  • Documentation: Check the /documentation folders
  • Issues: Report bugs via GitHub Issues
  • Discussions: Use GitHub Discussions for questions
  • Wiki: Check project wiki for troubleshooting

Troubleshooting


SpikeCam - Modern security camera system with real-time streaming and device management.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors