This is a boilerplate project for a web application with a .NET Core backend and a ReactJS frontend. The backend provides API endpoints, while the frontend consumes these endpoints to display and interact with data. This setup is designed to speed up initial development with ready-to-use configurations for database, frontend, and backend services.
- .NET Core Backend: Includes APIs with controller-based architecture.
- ReactJS Frontend: Simple UI to interact with backend APIs.
- Entity Framework Core: Manage database migrations.
- Frontend State Management: Currently uses MobX (planned to replace with Redux).
- Semantic UI: For styling components (planned to replace with Material UI).
- Database: Local development using SQL Server.
git clone https://github.com/your-repo/net-core-reactjs-boilerplate.git
cd net-core-reactjs-boilerplate
-
Navigate to the backend project directory:
cd Backend/
-
Restore NuGet packages:
dotnet restore
-
Apply database migrations:
dotnet ef database update OR dotnet build
-
Run the backend API server:
dotnet watch run OR dotnet watch --no-hot-reload
-
To drop the database (for development reset):
dotnet ef database drop --force
-
To add a new migration (after updating models):
dotnet ef migrations add MigrationName -p Persistence -s API
-
To update the database after a migration:
dotnet ef database update
-
Navigate to the frontend project directory:
cd reactjs-client-app/
-
Install npm dependencies:
npm install
-
Start the frontend development server:
npm start
-
Build the frontend for production:
npm run build
-
Ensure both backend and frontend servers are running:
- Backend:
dotnet watch run
- Frontend:
npm start
By default, the frontend will run on
https://localhost:3000
and the backend will run onhttp://localhost:5000
. - Backend:
- Remove MobX and implement Redux for state management in the React app.
- Remove Semantic UI and migrate to Material UI for styling.
- Clean up the codebase for better readability and maintainability.
- Restore packages:
dotnet restore
- Build project:
dotnet build
- Run project:
dotnet run
- Watch mode:
dotnet watch run
- Migrations:
- Add migration:
dotnet ef migrations add <MigrationName>
- Update database:
dotnet ef database update
- Drop database:
dotnet ef database drop --force
- Add migration:
- Install dependencies:
npm install
- Start development server:
npm start
- Build for production:
npm run build
- Linting:
npm run lint
- Run tests:
npm test
Feel free to contribute and submit pull requests!