🛠 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.
- ✨ Features
- 📌 Prerequisites
- 🚀 Installation Guide
- 🔧 Usage Instructions
- 📚 Project Structure
⚠️ Notes- 📝 License
- 🤝 Contributing
- 👨💻 Author
✅ 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 🎯
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)
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
brew install dotnet-sdk mysql
brew services start mysql
- Download and install .NET SDK 8
- Download and install MySQL
- Install GitBash if not already installed
git clone https://github.com/XhuyZ/setup-aspnet-3layer.git
cd setup-aspnet-3layer
chmod +x ~/script.sh
~/script.sh (Input Your Solution Name)
./db.sh
cd ~/MyProject/API
dotnet watch run
~/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
- 🏁 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
📚 Open-source under the MIT License
🚀 Contributions are welcome! Feel free to open an Issue or submit a Pull Request.
👉 GitHub: XhuyZ