feat: add version display to UI and API
Some checks failed
Basil CI/CD Pipeline / Shared Package Tests (pull_request) Successful in 1m15s
Basil CI/CD Pipeline / Code Linting (pull_request) Successful in 1m17s
Basil CI/CD Pipeline / Web Tests (pull_request) Successful in 1m29s
Basil CI/CD Pipeline / API Tests (pull_request) Failing after 1m37s
Basil CI/CD Pipeline / Security Scanning (pull_request) Successful in 1m9s
Basil CI/CD Pipeline / Build All Packages (pull_request) Has been skipped
Basil CI/CD Pipeline / E2E Tests (pull_request) Has been skipped
Basil CI/CD Pipeline / Build & Push Docker Images (pull_request) Has been skipped
Basil CI/CD Pipeline / Trigger Deployment (pull_request) Has been skipped

## Changes

### Version System
- Added version pattern: YYYY.MM.PATCH (e.g., 2026.01.1)
- Created version.ts files for both API and web packages
- Initial version: 2026.01.1

### Web UI
- Display version in small green text (light green: #90ee90) under Basil logo
- Added hover tooltip showing "Version 2026.01.1"
- Logo link also shows version in title attribute
- Styled with opacity transition for hover effect

### API
- Added /api/version endpoint returning JSON: {"version": "2026.01.1"}
- Updated server startup message to show version
- Console output: "🌿 Basil API server v2026.01.1 running on..."

### CSS Styling
- .logo-container: Flex column layout for logo and version
- .version: 0.65rem font, light green (#90ee90), 0.85 opacity
- Hover increases opacity to 1.0 for better visibility
- Cursor set to "help" to indicate tooltip

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Paul R Kartchner
2026-01-16 22:07:34 -07:00
parent 2171cf6433
commit 49db2ce0a4
5 changed files with 47 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import authRoutes from './routes/auth.routes';
import mealPlansRoutes from './routes/meal-plans.routes';
import './config/passport'; // Initialize passport strategies
import { testEmailConfig } from './services/email.service';
import { APP_VERSION } from './version';
dotenv.config();
@@ -45,13 +46,18 @@ app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
// Version endpoint
app.get('/api/version', (req, res) => {
res.json({ version: APP_VERSION });
});
// Export app for testing
export default app;
// Start server only if this file is run directly (not imported)
if (require.main === module) {
app.listen(PORT, async () => {
console.log(`🌿 Basil API server running on http://localhost:${PORT}`);
console.log(`🌿 Basil API server v${APP_VERSION} running on http://localhost:${PORT}`);
// Test email configuration on startup
await testEmailConfig();

View File

@@ -0,0 +1,5 @@
/**
* Application version following the pattern: YYYY.MM.PATCH
* Example: 2026.01.1 (January 2026, patch 1)
*/
export const APP_VERSION = '2026.01.1';