Welcome to the Nuxt Minimal Starter! This repository provides a foundational setup for a full-stack application using Nuxt 4, along with various useful Docker containers. For more detailed information, refer to the Nuxt documentation.
- Setup
- Development Server
- Production
- Mobile Application Setup
- Required Environment Variables
- Production Setup
- Security
Important
Ensure that you have Bun installed on your machine.
Install the necessary dependencies:
bun install
To start the development server, navigate to http://localhost:3000
:
bun run dev
To build the application for production, run:
bun run build
Warning
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 preview
Refer to the b.dev.yml
file to set up your full-stack application.
- Create a new
.env
file based on the.env.example
file and fill in your correct environment variables. - Run the following command to start your Docker containers:
docker compose -f b.dev.yml up -d --build
Congratulations! ๐๐ You are now running your own full-stack production-ready initial version of the project!
Make sure to update the domain name baderidris.com
in the b.dev.yml
file and its associated configuration files to your own domain name.
To add Android and iOS support, create the respective directories in your project:
bunx cap add android ios
To create your .env.capacitor
file, rename the existing example file:
mv .env.capacitor.example .env.capacitor
And add correct environment variables to it!
To customize your app icons, modify the icons in the /assets
folder as desired, then run:
bunx capacitor-assets generate --assetPath "./assets" --ios --android
You can review the configuration requirements in the
assets/requirements.md
file.
To build the Android app, ensure you have Android Studio installed on your machine and set the required environment variables.
Caution
Restart your shell session after adding the environment variables.
Key environment variables include:
ANDROID_HOME
CAPACITOR_ANDROID_STUDIO_PATH
Caution
Modify the values in the .env
file to reflect your specific configuration.
To create your .env
file, rename the existing example file:
mv .env.example .env
Caution
If you are using Windows, ensure that you install Git and use Git Bash for an improved development experience.
Important
Ensure that Docker is installed on your machine.
To initiate the production setup, run the following command at the project root level:
docker compose -f ./a.prod-certbot.yml up -d --build
Afterward, 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.
Important
replicas and docker swarm concerns
You have to name the root project dir as portfolio
or change server/config/nginx/nginx_with_certbot_secured.conf
file => upstream servers based on your container name?s or outer ip address?es
To automate certificate renewals, create a cron job by modifying the paths in the /server/config/nginx/ssl_renew.sh
file, then add this file 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>&1
Tip
Review the ssl_renew.sh
file for additional useful tips and configurations.
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 configuration:
ls server/config/fail2ban/
directory => filter.d
file => my_custom_jail.local
We have created custom jails and filters to allow users to add their configurations after installing the tool. This flexibility helps you tailor the security settings to your specific needs.
Thank you for using the Nuxt Minimal Starter! If you have any questions or need further assistance, feel free to reach out.