Skip to content

Commit fb40042

Browse files
Copilotgeofranzi
andcommitted
Add comprehensive GitHub Copilot instructions for BEXIS2 Core development
Co-authored-by: geofranzi <15946467+geofranzi@users.noreply.github.com>
1 parent 4291971 commit fb40042

File tree

1 file changed

+160
-0
lines changed

1 file changed

+160
-0
lines changed

.github/copilot-instructions.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# BEXIS2 Core Development Instructions
2+
3+
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
4+
5+
BEXIS2 is a comprehensive data management platform built with .NET Framework 4.8, ASP.NET MVC, C#, and PostgreSQL. It features a modular architecture with 76+ C# projects and a modern SvelteKit frontend.
6+
7+
## Working Effectively
8+
9+
### Bootstrap and Build the Repository
10+
- Install Visual Studio 2019+ or .NET Framework 4.8 SDK (Windows required for .NET Framework projects)
11+
- Install Node.js 20+ and npm for Svelte frontend components
12+
- Install PostgreSQL 12+ database server
13+
- Clone and set up the BEXIS2 Workspace repository (separate dependency)
14+
15+
### Build Commands (NEVER CANCEL - Set 60+ minute timeouts)
16+
**Svelte Frontend (Works on Linux/macOS/Windows):**
17+
```bash
18+
cd Console/BExIS.Web.Shell.Svelte
19+
rm -rf node_modules package-lock.json # If npm install fails
20+
npm install # 2-3 minutes. May need retry due to rollup issues
21+
npm run build # 13 seconds - builds frontend assets
22+
npm run test:unit # Runs unit tests with Vitest
23+
npm run lint # Lints TypeScript/Svelte code (has formatting issues)
24+
npm run check # TypeScript checking (has known errors in docs processing)
25+
```
26+
27+
**.NET Framework Projects (Windows Only):**
28+
```bash
29+
# Using Visual Studio or MSBuild
30+
msbuild BExIS++.sln /p:Configuration=Debug # 15-20 minutes. NEVER CANCEL. Set timeout to 60+ minutes
31+
# Or using dotnet (limited compatibility)
32+
dotnet restore BExIS++.sln # May fail on some projects - use NuGet Package Manager in VS
33+
```
34+
35+
**Database Setup:**
36+
- Install PostgreSQL server locally (port 5432)
37+
- Create database: `bexis2test` (for development/testing)
38+
- Default credentials: username=`postgres`, password=`1`
39+
- Connection string format: `Server=localhost;Port=5432;Database=bexis2test;Userid=postgres;Password=1;Pooling=true;MinPoolSize=2;MaxPoolSize=100;ConnectionIdleLifetime=3600;`
40+
41+
### Running the Application
42+
**NEVER run without proper database and workspace setup - the application will fail**
43+
44+
**Frontend Development (Independent):**
45+
```bash
46+
cd Console/BExIS.Web.Shell.Svelte
47+
npm run dev # Starts SvelteKit dev server on port 5173
48+
npm run preview # Preview production build
49+
```
50+
51+
**Full Application (.NET + Database Required):**
52+
- Set up Web.config from Web.config.sample with proper database connection
53+
- Configure workspace path in Web.config
54+
- Use IIS Express or Visual Studio F5 to run BExIS.Web.Shell project
55+
- Application requires workspace files and database to start properly
56+
57+
## Validation
58+
59+
### ALWAYS Test Frontend Changes
60+
- Run `npm run build` in Console/BExIS.Web.Shell.Svelte - NEVER CANCEL (13 seconds)
61+
- Run `npm run test:unit` to execute unit tests
62+
- Run `npm run lint` before committing - **NOTE**: Has known formatting issues to fix
63+
- TypeScript checking (`npm run check`) has known errors in documentation processing code
64+
65+
### Manual Validation Scenarios
66+
**After making frontend changes:**
67+
1. Build Svelte project successfully
68+
2. Run unit tests and ensure they pass
69+
3. Test in browser that components render correctly
70+
4. Verify no console errors in browser developer tools
71+
72+
**After making .NET changes:**
73+
1. Build solution in Visual Studio without errors
74+
2. Run relevant NUnit tests (if database available)
75+
3. Start application and verify it loads without exceptions
76+
4. Test basic navigation and module functionality
77+
78+
### Testing Infrastructure
79+
- **Frontend**: Vitest unit tests, Playwright end-to-end tests, ESLint + Prettier
80+
- **.NET**: NUnit unit tests, MSTest integration tests
81+
- **Test command timing**: Frontend tests: 1-2 seconds, .NET tests: varies by scope
82+
83+
## Important File Locations
84+
85+
### Configuration Files
86+
- `Console/BExIS.Web.Shell/Web.config.sample` - Main application configuration template
87+
- `Console/BExIS.Web.Shell.Svelte/package.json` - Frontend dependencies and scripts
88+
- `BExIS++.sln` - Main Visual Studio solution file (76 projects)
89+
- `.nuget/NuGet.Config` - NuGet package source configuration
90+
91+
### Key Directories
92+
- `Console/BExIS.Web.Shell/` - Main ASP.NET MVC web application
93+
- `Console/BExIS.Web.Shell.Svelte/` - Modern SvelteKit frontend
94+
- `Components/` - Core system components (AAA, DLM, DCM, IO, etc.)
95+
- `Modules/` - Feature modules (RPM, SAM, DIM, etc.)
96+
- `Libraries/` - External dependencies
97+
- `database update scripts/` - SQL scripts for database migrations
98+
99+
### Project Architecture
100+
**Components by Function:**
101+
- `AAA` - Authentication, Authorization, Accounting
102+
- `DLM` - Data Lifecycle Management
103+
- `DCM` - Data Collection Management
104+
- `DDM` - Data Discovery Management
105+
- `IO` - Input/Output operations
106+
- `XML` - XML processing utilities
107+
- `Utils` - Common utilities
108+
- `Vaiona` - Core framework libraries
109+
110+
## Common Commands Reference
111+
112+
### Build Timing Expectations
113+
- Svelte npm install: 2-3 minutes (may require retry)
114+
- Svelte build: 13 seconds
115+
- Svelte tests: 1-2 seconds
116+
- .NET solution build: 15-20 minutes MINIMUM - NEVER CANCEL
117+
- .NET test runs: 5-15 minutes depending on scope
118+
119+
### Frequent Issues and Solutions
120+
**npm install fails with rollup error:**
121+
```bash
122+
rm -rf node_modules package-lock.json
123+
npm install
124+
```
125+
126+
**npm run lint fails with formatting issues:**
127+
```bash
128+
npm run format # Fix formatting before linting
129+
```
130+
131+
**Visual Studio build fails:**
132+
- Restore NuGet packages in Package Manager Console
133+
- Check that .NET Framework 4.8 is installed
134+
- Verify PostgreSQL connection string in config files
135+
136+
**Database connection issues:**
137+
- Ensure PostgreSQL service is running
138+
- Check connection string format and credentials
139+
- Verify database `bexis2test` exists
140+
141+
### Repository Structure Quick Reference
142+
```
143+
/home/runner/work/Core/Core/
144+
├── BExIS++.sln # Main solution file
145+
├── Console/
146+
│ ├── BExIS.Web.Shell/ # ASP.NET MVC app
147+
│ └── BExIS.Web.Shell.Svelte/ # SvelteKit frontend
148+
├── Components/ # Core components
149+
├── Modules/ # Feature modules
150+
├── Libraries/ # External libs
151+
└── database update scripts/ # SQL migrations
152+
```
153+
154+
## Critical Warnings
155+
- **NEVER CANCEL** build operations - .NET builds take 15-20+ minutes minimum
156+
- **ALWAYS** set timeouts of 60+ minutes for build commands
157+
- **Database required** - Application cannot run without PostgreSQL and workspace setup
158+
- **Windows required** - .NET Framework projects require Windows development environment
159+
- **Workspace dependency** - Requires separate BEXIS2 Workspace repository setup
160+
- **Frontend can be developed independently** - Svelte project works without full backend setup

0 commit comments

Comments
 (0)