A web application for tracking aircraft components through their lifecycle stages, from manufacturing to deployment.
- Created project structure using Create React App for frontend
- Set up Node.js/Express backend
- Connected to MongoDB Atlas for database
-
Installed Backend Dependencies
- Express
- Mongoose
- Cors
- Dotenv
-
Created MongoDB Schema
- Designed component schema with fields:
- name
- serialNumber (unique)
- status
- manufacturingDate
- history tracking
- Implemented API Endpoints
- POST /api/components (Create new component)
- GET /api/components (List all components)
- PATCH /api/components/:id/status (Update status)
- Installed Frontend Dependencies
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled axios
- Created React Components
- ComponentForm: For adding new components
- ComponentList: Displays components in a table
- Used Material-UI for styling
- State Management
- Used React useState for form data
- Implemented useEffect for data fetching
- Added real-time updates using callback functions
- Add new components with validation
- View all components in a table format
- Track component status changes
- Real-time updates without page refresh
- Error handling and success messages
- Frontend: React, Material-UI
- Backend: Node.js, Express
- Database: MongoDB Atlas
- API Communication: Axios
- Styling: Material-UI components and sx props
-
React Documentation
- Hooks (useState, useEffect)
- Component lifecycle
- Form handling
-
Material-UI Documentation
- Component usage
- Styling with sx prop
- Table implementation
-
MongoDB Documentation
- Schema design
- CRUD operations
- Atlas setup
-
Express.js Documentation
- Route handling
- Middleware setup
- Error handling
-
Real-time Updates
- Challenge: List not updating after adding component
- Solution: Implemented callback function to refresh list
-
Form Validation
- Challenge: Ensuring unique serial numbers
- Solution: Added backend validation and error messages
-
Styling
- Challenge: Consistent design across components
- Solution: Used Material-UI's built-in components and theming
- Start Backend
- Start Frontend
aerotrack/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── ComponentForm.js
│ │ │ └── ComponentList.js
│ │ ├── App.js
│ │ └── index.js
│ └── public/
│ └── index.html
│
├── server/ # Node.js Backend
│ ├── controllers/ # Request handlers
│ │ └── componentController.js
│ ├── models/ # Database models
│ │ └── Component.js
│ ├── routes/ # API routes
│ │ └── componentRoutes.js
│ ├── .env # Environment variables
│ └── server.js # Server entry point
│
├── .gitignore # Git ignore file
└── README.md # Project documentation
- Clone the Repository
git clone [repository-url]
cd aerotrack
- Backend Setup
cd server
npm install
# Create .env file with your MongoDB URI
npm start
- Frontend Setup
cd client
npm install
npm start
- Environment Variables
Create a
.env
file in the server directory with:
MONGODB_URI=your_mongodb_connection_string
PORT=5000
GET /api/components
- Get all componentsPOST /api/components
- Create a new componentPATCH /api/components/:id/status
- Update component statusDELETE /api/components/:id
- Delete a component