A magazine announcement website with email collection and submission forms, backed by PostgreSQL database.
- Email Newsletter Signup: Collect email addresses for updates
- Submission Forms: Accept articles, photography, and video submissions with file uploads
- PostgreSQL Integration: All data stored in a PostgreSQL database
- Automated Deployment: GitHub Actions for CI/CD
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Visit the application: Open http://localhost:3000 in your browser
The application connects to a PostgreSQL database with the following tables:
newsletter_emails: Stores email subscriptionssubmissions: Stores form submissions with file references
The application uses GitHub Actions for automated deployment to your server.
To enable automatic deployment, add these secrets to your GitHub repository:
- Go to your GitHub repository
- Navigate to Settings > Secrets and variables > Actions
- Add the following secrets:
| Secret Name | Value | Description |
|---|---|---|
SERVER_HOST |
192.168.1.12 |
Your server IP address |
SERVER_USER |
pi |
SSH username |
SERVER_PASSWORD |
plants |
SSH password |
The GitHub Actions workflow:
- Build Stage: Tests the application on Node.js 18.x and 20.x
- Deploy Stage:
- Connects to your server via SSH
- Pulls the latest code
- Installs dependencies
- Starts/restarts the application using PM2
To deploy manually to your server:
# SSH into your server
ssh pi@192.168.1.12
# Navigate to application directory
cd /home/pi/magazine-website
# Pull latest changes
git pull origin main
# Install dependencies
npm ci --only=production
# Restart the application
pm2 restart plantos-magazine- Frontend: HTML, CSS, JavaScript
- Backend: Node.js, Express.js
- Database: PostgreSQL
- File Upload: Multer
- Process Management: PM2
- CI/CD: GitHub Actions
- Security: Firewall restrictions, environment variables
magazine-website/
├── server.js # Express server
├── index.html # Main webpage
├── script.js # Frontend JavaScript
├── styles.css # Styling
├── package.json # Dependencies
├── uploads/ # File upload directory
└── .github/workflows/ # GitHub Actions
└── deploy.yml # Deployment workflow