Skip to content

WEBtestTEAM88/BetterHomeAssistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Home Automation System

A modern, secure, and scalable home automation system built with Next.js, MQTT, and MongoDB.

Features

  • 🏠 Real-time device control and monitoring
  • 👥 Multi-user support with role-based access control
  • 🔐 Secure authentication and authorization
  • 📱 Responsive mobile-first design
  • 🎨 Customizable scenes and automation rules
  • 📊 Historical data tracking and analytics
  • 🏗️ Room-based organization
  • 🔌 Support for various device types (lights, thermostats, security, blinds)

Tech Stack

  • Frontend: Next.js, React, Material-UI
  • Backend: Next.js API Routes
  • Database: MongoDB with Prisma ORM
  • Real-time Communication: MQTT
  • Authentication: NextAuth.js
  • State Management: React Context
  • Styling: Material-UI with Emotion

Prerequisites

  • Docker and Docker Compose
  • Node.js v16+ (for local development)
  • Git

Installation

Using Docker (Recommended)

  1. Clone the repository:
git clone https://github.com/yourusername/home-automation.git
cd home-automation
  1. Create environment files:
# Create .env file for Docker
cat > .env << EOL
NEXTAUTH_SECRET=your-secret-key
DEFAULT_ADMIN_EMAIL=admin@homeautomation.com
DEFAULT_ADMIN_PASSWORD=secure-admin-password
MQTT_USER_PASSWORD=secure-mqtt-password
EOL

# Create .env.local file
cat > .env.local << EOL
MONGODB_URI=mongodb://mongodb:27017/home_automation
MQTT_HOST=mosquitto
MQTT_PORT=1883
MQTT_WS_PORT=8888
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
DEFAULT_ADMIN_EMAIL=admin@homeautomation.com
DEFAULT_ADMIN_PASSWORD=secure-admin-password
MQTT_USER_PASSWORD=secure-mqtt-password
EOL
  1. Build and start the services:
# Build and start all containers
docker-compose up -d --build

# Create admin user (first time only)
docker-compose exec app npm run setup-admin

# Set up MQTT password
docker-compose exec mosquitto sh -c "mosquitto_passwd -c /mosquitto/config/passwd admin"
  1. Access the application:

Local Development Setup

  1. Install dependencies:
npm install
  1. Generate Prisma client:
npx prisma generate
  1. Push database schema:
npx prisma db push
  1. Create admin user:
npm run setup-admin
  1. Start the development server:
npm run dev

Docker Services

The application runs three main services:

  1. App (Next.js application)

    • Port: 3000
    • Main web interface
  2. **

Usage

Visit http://localhost:3000 to access the application. Create an admin account on first run.

Configuration

Detailed configuration instructions for:

  • MongoDB setup
  • MQTT broker setup
  • Device integration
  • Authentication providers

Can be found in our Configuration Guide.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Support

For support, please open an issue in the GitHub repository or contact the maintainers.

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors