This guide covers deployment options and configuration for the portfolio website. The application is built with Node.js and React, using PostgreSQL for data storage. It can be deployed on any platform that supports these technologies.
This project is a platform-agnostic full-stack application that can be deployed on any hosting service that supports Node.js and PostgreSQL. This guide will walk you through the deployment process for various platforms and configurations.
- Modern React frontend with TypeScript
- Express.js backend with RESTful API
- PostgreSQL database with Drizzle ORM
- GitHub integration for project synchronization
- Analytics dashboard
- Content management system
- Blog system with comments
-
Clone the repository:
git clone https://github.com/Xza85hrf/Modern-portfolio-dashboard.git cd Modern-portfolio-dashboard
-
Replace the package.json with the clean template:
# Backup existing package.json (optional) cp package.json package.json.backup # Copy the template to package.json cp package.template.json package.json # Install dependencies npm install
-
Build the application:
npm run build
Note: The package.template.json file contains a clean configuration without any platform-specific dependencies while maintaining all core functionality. This ensures a smooth deployment process across different hosting platforms.
- Node.js v18 or newer
- PostgreSQL 12 or newer
- npm or yarn package manager
# Database Configuration
DATABASE_URL=postgresql://user:password@host:port/dbname
PGUSER=your_db_user
PGPASSWORD=your_db_password
PGHOST=your_db_host
PGPORT=your_db_port
PGDATABASE=your_db_name
# Port Configuration (Optional)
PORT=5000 # Specify custom port for deployment
# GitHub Integration (Optional)
GITHUB_TOKEN=your_github_token
# Security
JWT_SECRET=your_jwt_secret
COOKIE_SECRET=your_cookie_secret
- Default port is 5000
- Can be customized using
PORT
environment variable - Server automatically finds next available port if specified port is in use
- Useful for avoiding port conflicts in different environments
-
Clone and prepare the repository:
git clone https://github.com/Xza85hrf/Modern-portfolio-dashboard.git cd Modern-portfolio-dashboard
-
Install dependencies:
npm install
-
Set up environment variables:
- Copy the
.env.template
file to.env
- Fill in all required environment variables
- Ensure database credentials are correct
- Generate secure values for JWT_SECRET and COOKIE_SECRET
- (Optional) Set custom PORT if needed
- Copy the
-
Initialize the database:
# Create database tables and initial schema npm run db:push
-
Build the application:
# Build frontend assets and server npm run build
-
Start the production server:
# Start the application on default or specified port npm start # Or specify a custom port PORT=3000 npm start
-
Verify the installation:
- Access the application at http://localhost:PORT
- Confirm database connectivity
- Test admin dashboard access
- Verify GitHub integration (if configured)
-
Server Setup:
# Install Node.js curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs # Install PostgreSQL sudo apt-get install postgresql postgresql-contrib # Install Nginx sudo apt-get install nginx
-
Configure Nginx as reverse proxy:
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:5000; 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; } }
-
Set up process management:
# Install PM2 npm install -g pm2 # Start application pm2 start npm --name "portfolio" -- start # Enable startup script pm2 startup pm2 save
-
Configure SSL with Let's Encrypt:
sudo apt-get install certbot python3-certbot-nginx sudo certbot --nginx -d your-domain.com
-
Install Heroku CLI
-
Configure application:
heroku create your-app-name heroku addons:create heroku-postgresql:hobby-dev heroku config:set NODE_ENV=production heroku config:set JWT_SECRET=your-secret heroku config:set COOKIE_SECRET=your-secret git push heroku main
- Connect GitHub repository
- Select Node.js environment
- Add PostgreSQL database
- Configure environment variables
- Deploy application
- Connect to GitHub repository
- Select Node.js template
- Add PostgreSQL service
- Configure build command:
npm run build
- Configure start command:
npm start
- Set environment variables
- Deploy application
-
Create PostgreSQL database
-
Run migrations:
npm run db:push
-
Verify database connection
-
Set secure environment variables:
- Generate strong JWT_SECRET
- Generate secure COOKIE_SECRET
- Store GitHub token securely
-
Configure CORS if needed:
app.use(cors({ origin: process.env.ALLOWED_ORIGINS?.split(',') || [], credentials: true }));
-
Set up rate limiting and security headers
-
Health Checks:
- Database connectivity
- GitHub API integration
- Authentication system
- Analytics tracking
-
Regular Tasks:
- Database backups
- Log rotation
- Security updates
- Performance monitoring
-
Backup Strategy:
- Daily database backups
- Configuration backups
- Content backup schedule
For deployment assistance:
- Check troubleshooting guides
- Review documentation
- Open GitHub issues
- Contact support team