A full-stack application for managing orders, built with .NET 9 and React.
order-management/
├── OrderManagement.API/ # Backend API project
├── OrderManagement.Core/ # Core business logic and models
├── OrderManagement.Data/ # Data access layer
├── OrderManagement.API.Tests/ # API tests
├── OrderManagement.Core.Tests/ # Core logic tests
├── OrderManagement.Data.Tests/ # Data layer tests
├── database/ # SQL scripts
│ └── scripts/
│ ├── 01_InitialSchema.sql
│ ├── 02_Triggers.sql
│ └── 03_InitialData.sql
└── order-management-ui/ # Frontend React application
- SQL Server 2019 or later
- .NET 9.0 SDK
- Node.js 18 or later
- npm 9 or later
- Open SQL Server Management Studio (SSMS)
- Connect to your SQL Server instance
- Execute the SQL scripts in the following order:
database/scripts/01_InitialSchema.sql database/scripts/02_Triggers.sql database/scripts/03_InitialData.sql
-
Clone the repository
git clone https://github.com/Jadhielv/order-management.git cd order-management
-
Update the connection string in
OrderManagement.API/appsettings.json
:{ "ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=OrderManagementDB;Trusted_Connection=True;MultipleActiveResultSets=true" } }
-
Build and run the solution:
dotnet build cd OrderManagement.API dotnet run
The API will be available at http://localhost:5283
dotnet test
-
Navigate to the UI project:
cd order-management-ui
-
Install dependencies:
npm install
-
Start the development server:
npm start
The application will be available at http://localhost:3000
- GET
/api/orders
- Get all orders - GET
/api/orders/{id}
- Get order by ID - POST
/api/orders
- Create new order - PUT
/api/orders/{id}
- Update order - DELETE
/api/orders/{id}
- Delete order - GET
/api/orders/statistics
- Get order statistics
The database scripts are versioned and should be applied in sequence:
01_InitialSchema.sql
: Creates the database and tables02_Triggers.sql
: Sets up triggers for statistics and auditing03_InitialData.sql
: Adds initial test data
When updating the database schema:
- Create a new numbered script (e.g.,
04_AddNewFeature.sql
) - Document the changes in this README
- Apply the script to all environments in sequence
- Pull the latest changes
- Apply any new database scripts
- Build and run the API
- Start the React application
- Make your changes
- Run tests
- Commit and push
- Verify SQL Server is running
- Check connection string in appsettings.json
- Ensure database exists and user has proper permissions
- Check API logs in the console
- Verify correct ports are being used
- Ensure all dependencies are installed
- Clear npm cache:
npm cache clean --force
- Delete node_modules and reinstall:
rm -rf node_modules && npm install
- Check browser console for errors
- Create a feature branch
- Make your changes
- Run tests
- Create a pull request
This project is licensed under the MIT License - see the LICENSE file for details