This application is a React-based user interface with a resizable layout, consisting of three components where users can dynamically resize components by dragging them from sides. Additionally, APIs are provided to add and edit data within these components.
- Three windows with responsive design for all laptop devices.
- Users can resize components by dragging them from side.
- Neighbor windows automatically expand or shrink based on resizing operations.
- API endpoints: /todos and /count.
- /todo/add): allows users to add new data, creating a new entry in the table.
- todos/update: Allows users to update existing data, modifying the entry in the table.
- /count/add: Creates an entry based on window in which first new entry made and initialised the count with 1
- /count/update: Updates count on new entry and updation made to table entries with update button
- ReactJS for the frontend.
- Open-source library react-resizable-layout for resizable functionality.
- MongoDB for storing data.
- NodeJs and ExpressJs for API development.
- Clone the repository
git clone https://github.com/Shubham0442/dataneuron-assignment
- Navigate to the frontend folder
cd frontend/
- Install dependencies
npm install
- Run the application
npm start
- Navigate to the backend folder
cd backend/
- Install dependencies
npm install
- Run the application
npm run dev
- Endpoint: /todos?window={name of window}
- Method: GET
- Description: gets data of todos in respective window table.
- Parameters:- query: window
- Returns: {data: Array of todos of respective window }
- Endpoint: /todos/add
- Method: POST
- Description: adds new data to the respective window table.
- Parameters: name, isCompleted, window
- Returns: {msg: "New todo added"}
- Endpoint: /todos/update/:id
- Method: PATCH
- Description: Allows users to update existing data in the respective windowtable.
- Parameters:- param: id, data: window, isCompleted
- Returns: { msg: "todo updated" }
- Endpoint: /count/?window={name of window}
- Method: GET
- Parameters:- query: window
- Description: Displays the number of times Add and Edit APIs have been called.
- Returns: { data: Array of count of respective window }
- Endpoint: /count/update/:id
- Method: PATCH
- Parameters:- param: id, count, window
- Description: updates the count value for the respective window on add and update of todos.
- Returns: { msg: "count updated" }
- Endpoint: /count/add
- Method: POST
- Parameters:- count, window
- Description: adds the count for the first entry of respective window
- Returns: { msg: "New count added" }
- MongoDB
- Todos Schema:
{ name: String, isCompleted: Boolean, window: String }
- Count Schema:
{ count: number, window: String }