Installation Guide
System Requirements
Hardware Requirements
- CPU: 4+ cores
- RAM: 8GB minimum, 16GB recommended
- Storage: 50GB minimum
Software Requirements
- Node.js v18 or higher
- MongoDB v6 or higher
- Docker (optional)
- Nginx (for production)
Installation Methods
1. Docker Installation (Recommended)
- Pull Docker Images
docker pull eyenet/backend:latest
docker pull eyenet/frontend:latest
docker pull mongo:latest
- Create Docker Network
docker network create eyenet-network
- Start MongoDB
docker run -d \
--name mongodb \
--network eyenet-network \
-v mongodb_data:/data/db \
-e MONGO_INITDB_ROOT_USERNAME=admin \
-e MONGO_INITDB_ROOT_PASSWORD=secret \
mongo:latest
- Start Backend
docker run -d \
--name eyenet-backend \
--network eyenet-network \
-p 3000:3000 \
-e MONGODB_URI=mongodb://admin:secret@mongodb:27017/eyenet \
-e JWT_SECRET=your_jwt_secret \
eyenet/backend:latest
- Start Frontend
docker run -d \
--name eyenet-frontend \
--network eyenet-network \
-p 3001:3000 \
-e NEXT_PUBLIC_API_URL=http://localhost:3000/api \
eyenet/frontend:latest
2. Manual Installation
- Install MongoDB
# Ubuntu
sudo apt-get update
sudo apt-get install -y mongodb
# Start MongoDB
sudo systemctl start mongodb
sudo systemctl enable mongodb
- Clone Repository
git clone https://github.com/TadashiJei/EyeNetProject.git
cd EyeNetProject
- Install Backend
cd eyenet/backend
npm install
npm run build
# Create systemd service
sudo nano /etc/systemd/system/eyenet-backend.service
[Unit]
Description=EyeNet Backend Service
After=network.target
[Service]
Type=simple
User=eyenet
WorkingDirectory=/path/to/eyenet/backend
ExecStart=/usr/bin/npm start
Restart=always
Environment=NODE_ENV=production
Environment=PORT=3000
Environment=MONGODB_URI=mongodb://localhost:27017/eyenet
Environment=JWT_SECRET=your_jwt_secret
[Install]
WantedBy=multi-user.target
- Install Frontend
cd ../frontend
npm install
npm run build
# Create systemd service
sudo nano /etc/systemd/system/eyenet-frontend.service
[Unit]
Description=EyeNet Frontend Service
After=network.target
[Service]
Type=simple
User=eyenet
WorkingDirectory=/path/to/eyenet/frontend
ExecStart=/usr/bin/npm start
Restart=always
Environment=NODE_ENV=production
Environment=NEXT_PUBLIC_API_URL=http://localhost:3000/api
[Install]
WantedBy=multi-user.target
- Start Services
sudo systemctl start eyenet-backend
sudo systemctl enable eyenet-backend
sudo systemctl start eyenet-frontend
sudo systemctl enable eyenet-frontend
Production Setup
1. Nginx Configuration
# /etc/nginx/sites-available/eyenet
server {
listen 80;
server_name eyenet.example.com;
location / {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /api {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
2. SSL Configuration
# Install Certbot
sudo apt-get install certbot python3-certbot-nginx
# Get SSL certificate
sudo certbot --nginx -d eyenet.example.com
3. MongoDB Security
- Enable Authentication
# Create admin user
mongo
use admin
db.createUser({
user: "admin",
pwd: "secure_password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})
- Update MongoDB Configuration
# /etc/mongodb.conf
security:
authorization: enabled
4. Firewall Configuration
# Allow necessary ports
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 27017/tcp
Post-Installation
1. Verify Installation
# Check services
sudo systemctl status eyenet-backend
sudo systemctl status eyenet-frontend
sudo systemctl status mongodb
sudo systemctl status nginx
# Check logs
sudo journalctl -u eyenet-backend
sudo journalctl -u eyenet-frontend
2. Initial Setup
- Create admin user
- Configure network devices
- Set up monitoring
- Configure backup system
3. Backup Configuration
- Set up MongoDB backups
- Configure log rotation
- Set up system backups
- Test restore procedures