Welcome to Cogtive's technical challenge! This repository contains a simplified version of our industrial IoT platform architecture to help us evaluate your skills as a developer.
Cogtive is a SaaS platform for factory floor operations, focused on:
- Production tracking and efficiency monitoring (OEE)
- Equipment, process stages, and batch management
- Real-time data collection
- IoT device integration
- Offline operation with later synchronization
- Backend: .NET Core API with Entity Framework Core
- Frontend Web: React with TypeScript
- Mobile: Xamarin.Forms (with optional migration to .NET MAUI)
- Databases: SQLite (default), PostgreSQL (optional)
- Containerization: Docker & Docker Compose (optional)
/backend: .NET Core API service/web: React frontend application/mobile: Xamarin.Forms mobile application for industrial operators/iot-simulator: IoT device simulator for generating metrics data (for senior level)/scripts: Utility scripts for environment reset and application startupdocker-compose.yml: Configuration for running all services
- .NET SDK (6.0 or later)
- Node.js (16 or later)
- Visual Studio or Visual Studio Code for mobile development
- (Optional) Docker & Docker Compose
For a quick start, use the provided scripts:
# Start the backend and frontend
./scripts/start-app.sh
# If you need to reset the environment first
./scripts/reset-environment.sh# Start the backend and frontend
scripts\start-app.bat
# If you need to reset the environment first
scripts\reset-environment.batcd backend
dotnet restore
dotnet runThe API will be available at the URL shown in the console output (typically https://localhost:5211).
API endpoints:
- GET
/api/machines- Returns a list of industrial machines - GET
/api/production-data- Returns production metrics - GET
/api/machines/{id}- Returns a specific machine - GET
/api/machines/{id}/production-data- Returns production data for a specific machine - POST
/api/production-data- Adds new production data (for IoT simulator)
cd web
npm install
npm startThe web app will be available at http://localhost:3000.
cd mobile
dotnet restore
# Open the .csproj in Visual StudioThe mobile app is designed for factory operators to record production data and interact with IoT devices on the shop floor. For Android emulator testing, it uses 10.0.2.2 to connect to the API on your host machine.
Choose the level that matches your experience. Each level includes all requirements from previous levels.
Objective: Demonstrate your ability to understand and work with an existing codebase.
Required Deliverables:
-
Working Environment Setup
- Get the backend API running with SQLite database
- Get the frontend web application displaying machine data
- Verify the connection between components
-
Intentional Error Identification
- Find and document the intentional error in the data model (hint: check the
Efficiencyproperty in production data) - Create a brief markdown document explaining what's wrong and how it affects the application
- Find and document the intentional error in the data model (hint: check the
-
Basic Improvement (choose ONE)
- Add proper validation attributes to the backend models
- Improve the UI of the machine listing in the frontend
- Add a loading indicator to the frontend while data is being fetched
Evaluation Focus:
- Following setup instructions correctly
- Understanding basic code structure
- Attention to detail in finding the intentional error
- Clean, readable code for your improvement
Objective: Demonstrate your ability to implement better architecture and add meaningful features.
Required Deliverables:
-
Data Model Fix
- Fix the intentional error in the data model (changing
Efficiencyfrom string to decimal/number) - Update all components to work with the fixed data model
- Ensure proper type conversion in the API and frontend
- Fix the intentional error in the data model (changing
-
Error Handling
- Implement comprehensive error handling in the React frontend
- Add appropriate user feedback (error messages, loading states)
- Make sure the UI gracefully handles API failures
-
Frontend Enhancements
- Implement filtering of machines by status (active/inactive)
- Implement sorting of machines by name, type, and status
- Add a search functionality to find machines by name or serial number
-
Automated Testing
- Add unit tests for at least one backend component
- Add unit tests for at least one frontend component
- Ensure tests can be easily run with standard commands
Evaluation Focus:
- Clean architecture and code organization
- Proper implementation of state management
- User experience considerations
- Testing strategy and implementation
Objective: Demonstrate your ability to architect complex systems and implement advanced features.
Required Deliverables:
-
Database Integration
- Implement PostgreSQL integration instead of SQLite
- Configure proper database migrations
- Document the setup process in your submission README
-
Containerization
- Update Docker configuration for all components
- Ensure proper networking between Docker containers
- Provide Docker Compose configuration for easy startup
-
Mobile App Enhancement
- Migrate at least one component of the mobile app to .NET MAUI
- Ensure the migrated component functions correctly
- Document the migration process and any challenges faced
-
IoT Integration
- Implement the IoT device simulator to generate random machine metrics
- Establish connection between the simulator and API
- Display real-time updates in the frontend when new data arrives
- Add a visualization component for the metrics data
-
Architecture Documentation
- Provide a detailed markdown document proposing architectural improvements
- Include diagrams (can be simple) illustrating your proposed architecture
- Address scalability, maintainability, and code organization concerns
Evaluation Focus:
- System architecture and design decisions
- Implementation quality of advanced features
- Documentation clarity and thoroughness
- DevOps and containerization approach
- Real-time data handling capabilities
Your submission will be evaluated based on:
- Code Quality: Well-structured, readable, and maintainable code
- Technical Understanding: Proper use of technologies and design patterns
- Problem Solving: Ability to identify and fix issues effectively
- Architecture: Component organization and interaction (especially for senior level)
- Documentation: Clear explanations and setup instructions
If you encounter issues with the database or environment, reset it using:
# Unix/Mac/Linux
./scripts/reset-environment.sh
# Windows
scripts\reset-environment.batFor more detailed reset instructions, see ENVIRONMENT-RESET.md.
- Database Errors: If you see SQLite errors like "no such table", use the reset script to recreate the database.
- TypeScript Errors: For React type issues, run
npm install --save-dev @types/react @types/react-dom. - CORS Issues: If the frontend can't connect to the backend, check CORS configuration in Program.cs.
- Docker Issues: Ensure all needed Dockerfiles exist and configuration is correct.
- Mobile Connection: Android emulators use
10.0.2.2for localhost; iOS simulators uselocalhostor127.0.0.1.
- Fork this repository
- Implement your solution based on your chosen level
- Submit a pull request OR send us a zip file of your solution
- Include a README with:
- Which level you completed
- Your approach to solving the tasks
- Any challenges you faced and how you solved them
- Setup instructions for reviewing your solution
- Any additional notes or considerations
Good luck, and we look forward to seeing your solution!