Skip to content

XhuyZ/setup-aspnet-3layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

🚀 ASP.NET 3-Layer Setup Script

250310_03h34m59s_screenshot

🛠 This script automatically generates a 3-layer architecture for ASP.NET Core Web API on Linux, macOS, and Windows. It sets up the necessary directories, initializes the project, and installs essential packages.


📜 Table of Contents


✨ Features

✅ Automatically creates a professional 3-layer project structure:

  • 🏷 API Layer (Web API project)
  • 💠 BLL Layer (Business Logic Layer)
  • 💾 DAL Layer (Data Access Layer)
  • 🛠 Common Layer (Shared utilities)

✅ Initializes the project using .NET CLI
✅ Configures dependencies between layers
✅ Installs required NuGet packages
✅ Displays a visual progress indicator 🎯


📌 Prerequisites

Ensure your system has the following tools installed:

  • .NET SDK 8 and runtime
  • Bash (Required for Linux and Windows when using GitBash)
  • MySQL (Set the root password to 12345, or modify it in line 2055 of the script)

🛠 Installing .NET SDK 8 and MySQL

Ubuntu

sudo apt update && sudo apt install -y dotnet-sdk-8.0 aspnetcore-runtime-8.0 mysql-server
sudo systemctl start mysql
sudo systemctl enable mysql

macOS

brew install dotnet-sdk mysql
brew services start mysql

Windows (Using GitBash)

  1. Download and install .NET SDK 8
  2. Download and install MySQL
  3. Install GitBash if not already installed

🚀 Usage Instructions

1️⃣ Clone the repository:

git clone https://github.com/XhuyZ/setup-aspnet-3layer.git
cd setup-aspnet-3layer

2️⃣ Grant execution permission to the script:

chmod +x ~/script.sh

3️⃣ Run the script with your desired project name:

~/script.sh (Input Your Solution Name)

4️⃣ Once the setup is complete, start the project:

./db.sh
cd ~/MyProject/API
dotnet watch run

📚 Project Structure

~/MyProject/
│── API/        # Web API project
│── BLL/        # Business Logic Layer
│── DAL/        # Data Access Layer
│── Common/     # Shared utilities
~/script.sh     # Installation script
~/db.sh         # Database setup script

⚠️ Notes

  • 🏁 The script provides a visual installation progress 🎯
  • 🔐 Ensure the script has execution permission before running
  • 🛠 Supports MySQL using Pomelo.EntityFrameworkCore
  • 📌 Follows standard ASP.NET Core Web API architecture

📝 License

📚 Open-source under the MIT License


🤝 Contributing

🚀 Contributions are welcome! Feel free to open an Issue or submit a Pull Request.


👨‍💻 Author

👉 GitHub: XhuyZ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages