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

Releases

Packages

Contributors

Languages