Prerequisite: Complete the Quick Start Guide before proceeding with development.
Development Environment
Meridian uses a monorepo structure with separate frontend and backend applications that communicate via REST APIs and WebSockets.Project Structure
Running Development Servers
Option 1: Run Both Together
From the root directory:- Frontend on
http://localhost:3000 - Backend on
http://localhost:5001
Option 2: Run Separately
Frontend:Custom Ports
Frontend:Development Workflow
1. Create a Feature Branch
2. Make Your Changes
- Frontend: Edit files in
Meridian/frontend/src/ - Backend: Edit files in
Meridian/backend/
3. Test Your Changes
4. Format Code
5. Commit and Push
Frontend Development
Key Technologies
- React - UI framework
- SCSS - Styling
- Context API - State management
- React Router - Navigation
- WebSocket - Real-time updates
Component Structure
State Management
Meridian uses React Context API for global state:AuthContext- User authenticationCacheContext- API response cachingErrorContext- Error handlingNotificationContext- NotificationsWebSocketContext- Real-time connections
Styling Guidelines
- Use SCSS modules for component styles
- Follow BEM naming convention
- Keep styles co-located with components
Backend Development
API Structure
Creating a New Route
Database Migrations
Code Quality
Linting
Type Checking
For TypeScript files:Debugging
Frontend Debugging
- Use React Developer Tools browser extension
- Check browser console for errors
- Use
console.log()strategically (remove before committing)
Backend Debugging
- Use
console.log()ordebuggerstatements - Check server logs in terminal
- Use Postman/Insomnia for API testing
Database Debugging
Testing
Frontend Tests
Backend Tests
Environment Variables
Never commit.env files. Use .env.example as a template:
Common Issues
Module Not Found
Module Not Found
Solution: Delete
node_modules and reinstall:Port Already in Use
Port Already in Use
Solution: Kill the process using the port:
Database Connection Failed
Database Connection Failed
Solution: Ensure PostgreSQL is running and credentials are correct:
WebSocket Connection Failed
WebSocket Connection Failed
Solution: Check backend WebSocket server is running and CORS is configured correctly.
Best Practices
-
Write Descriptive Commits: Use conventional commit format
- Keep Components Small: Single responsibility principle
- Use TypeScript: For better type safety (where applicable)
- Test Your Code: Write unit and integration tests
- Document Complex Logic: Add comments for non-obvious code
- Follow Code Style: Use Prettier and ESLint
Resources
Frontend Guide
Detailed frontend architecture guide
API Reference
Complete API documentation
SAML Auth
Authentication setup guide
Quick Start
Setup instructions