A simple React application for managing notes using Redux Toolkit, TypeScript, and Tailwind CSS.
You can check out the live version of the project here:
š Live App Link
Clone the repository:
git clone https://github.com/Rafid13iit/notes-manager-redux-toolkit-learning-own-project
Navigate to the project directory:
cd notes-manager-redux-toolkit-learning-own-project
Install dependencies:
npm install
or
yarn install
Start the development server:
npm run dev
or
yarn run dev
Open your browser and visit http://localhost:5173
src/
āāā app/
ā āāā store.ts # Redux store configuration
āāā components/
ā āāā NoteForm.tsx # Form for adding/editing notes
ā āāā NoteItem.tsx # Individual note component
ā āāā NotesList.tsx # List of all notes
āāā hooks/
ā āāā hooks.ts # Custom Redux hooks
āāā features/
ā āāā notes/
ā āāā notesSlice.ts # Redux slice for notes
ā āāā notesType.ts # TypeScript interfaces
ā
āāā App.tsx # Main application component
āāā main.tsx # Application entry point
This project demonstrates several key concepts of Redux Toolkit:
// src/app/store.ts
import { configureStore } from '@reduxjs/toolkit';
import notesReducer from '../features/notes/notesSlice';
export const store = configureStore({
reducer: {
notes: notesReducer,
},
});
// src/features/notes/notesSlice.ts
const notesSlice = createSlice({
name: 'notes',
initialState,
reducers: {
addNote: (state, action) => {
// Add a new note
},
updateNote: (state, action) => {
// Update existing note
},
deleteNote: (state, action) => {
// Delete a note
},
},
// ...
});
// src/features/notes/notesSlice.ts
export const fetchNotes = createAsyncThunk('notes/fetchNotes', async () => {
// Simulated API call
return new Promise<Note[]>((resolve) => {
setTimeout(() => {
// Return sample data
}, 1000);
});
});
// src/app/hooks.ts
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;