A comprehensive full-stack portfolio application built with Nuxt 4, featuring real-time communication, authentication, and multi-platform support. For more detailed information, refer to the Nuxt documentation.
- Prerequisites
- Getting Started
- Development
- Environment Configuration
- Docker Setup
- Building for Production
- Mobile Application
- Electron Application
- Production Deployment
- Security
- Troubleshooting
Before starting with this project, ensure you have the following tools installed on your system:
Docker Installation:
# Download and run the official Docker installation script
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Add current user to docker group (Linux only)
sudo usermod -aG docker $USERImportant
After installing Docker, it's recommended to follow the Docker post-installation steps for enhanced security and performance, including running Docker as a non-root user and configuring additional security options.
Bun Installation:
# Using the official Bun installer
curl -fsSL https://bun.sh/install | bash
# Or using npm
npm install -g bunGit Installation:
# For Ubuntu/Debian
sudo apt install git
# For macOS
xcode-select --install
# For Windows, download from https://git-scm.com/Important
After running usermod -aG docker $USER, you must log out and log back in or reboot to apply the Docker group changes. For additional post-installation configurations, refer to the Docker post-installation steps.
git clone https://github.com/Bader-Idris/nuxt4-fullstack-portfolio.git ./portfolio
# It's recommended to rename the project directory to 'portfolio', if you didn't use prior command
sudo mv nuxt4-fullstack-portfolio portfolio
cd portfolioImportant
Ensure you have Bun installed before running these commands.
bun installTo start the development server, navigate to http://localhost:3000:
bun run devTip
For the complete development experience with all backend services, use the Docker setup as described below.
Create your environment configuration from the example file:
cp .env.example .envCaution
Modify the values in the .env file to reflect your specific configuration.
Caution
If you are using Windows, ensure that you install Git and use Git Bash for an improved development experience.
The project includes environment configuration for different platforms:
.env.example- Main application environment variables.env.electron.example- Electron application environment variables.env.capacitor.example- Mobile application environment variables
The project uses Docker Compose for a complete development environment that includes all necessary backend services.
-
Configure Environment Variables
cp .env.example .env # Edit .env with your configuration -
Start Docker Services
docker compose -f b.dev.yml up -d --build
-
Access the Application
- Frontend:
http://localhost:3000 - Backend services will be automatically configured
- Frontend:
Warning
The application uses intensive backend services and runs best with Docker for a consistent experience.
Important
Ensure Docker is installed on your production machine.
To deploy in production with SSL certificates:
docker compose -f ./a.prod-certbot.yml up -d --buildImportant
CRITICAL: The project directory MUST be named portfolio for production deployment. The Nginx configuration is hardcoded to look for containers from the portfolio directory. If you cloned the repository with a different name, you must either rename the directory to portfolio or update the Nginx configuration files accordingly.
To build the application for production:
bun run buildWarning
If you're trying to build the app on a weak server with limited resources, please follow the instructions in the weak_servers.md file to ensure a successful build process.
To locally preview the production build:
bun run previewTip
A pre-built Docker image is available on Docker Hub. You can find instructions on how to pull the image and run it with Docker Compose in the repository's documentation.
To add Android and iOS support:
bunx cap add android iosCreate the mobile environment file:
cp .env.capacitor.example .env.capacitor
# Configure the environment variablesTo customize your app icons, modify the icons in the /assets folder as desired, then run:
bunx capacitor-assets generate --assetPath "./assets" --ios --androidYou can review the configuration requirements in the
assets/requirements.mdfile.
Warning
Required to prevent app crashes with push notifications.
To run properly without crashing the mobile app, you must have the file android/app/google-services.json. Check the Capacitor documentation and Firebase documentation.
To build the Android app, ensure you have Android Studio installed and set these environment variables:
ANDROID_HOMECAPACITOR_ANDROID_STUDIO_PATH
Caution
Restart your shell session after adding the environment variables.
To create a production build for Electron:
-
Create the Electron environment file:
cp .env.electron.example .env.electron # Configure the environment variables -
Use the following commands to build the Electron application:
bun run build:electron: Build for the current platformbun run build:electron:all: Build for Windows, macOS, and Linuxbun run build:electron:win: Build for Windows onlybun run build:electron:mac: Build for macOS onlybun run build:electron:linux: Build for Linux onlybun run build:electron:dir: Build in an unpackaged directory for testing
Make sure to update the domain name baderidris.com in the b.dev.yml file and associated configuration files to your own domain name.
To automate certificate renewals, create a cron job by modifying the paths in the /server/config/nginx/ssl_renew.sh file, then add this to your crontab:
# To edit your crontab, run:
crontab -e
# Add the following line to schedule the renewal script:
0 12 * * * /home/bader/portfolio/server/config/nginx/ssl_renew.sh >> /var/log/cron.log 2>&1Tip
Review the ssl_renew.sh file for additional useful tips and configurations.
After the initial deployment, you will need to force Certbot to renew certificates to remove the --staging flag. It is recommended to create a separate compose file for this purpose and for future renewals.
To enhance the security of your application and prevent common attacks such as DDoS, we have implemented Fail2Ban.
The following files are included in the security configuration:
ls server/config/fail2ban/
# Contains:
# - filter.d directory
# - my_custom_jail.local fileCustom jails and filters have been created to allow users to add their configurations after installing the tool. This flexibility helps you tailor the security settings to your specific needs.
- Weak Server Builds: Refer to weak_servers.md for build optimization on limited resources
- Docker Issues: Ensure Docker and Docker Compose are properly installed and running
- Environment Variables: Make sure all required environment variables are properly configured
Thank you for using the Portfolio Full-Stack Application! If you have any questions or need further assistance, feel free to reach out.