![]() |
VOOZH | about |
The Task Manager app tool is designed to simplify task management with CRUD operation: creation, deletion, and modification of tasks. Users can easily generate new tasks, remove completed ones, and update task details. In this step-by-step tutorial, you will learn the process of building a Basic Task Manager App with Express, React and GraphQL.
Preview of final output: Let us have a look at how the final application will look like.
Step 1: Create a new directory for your project and navigate it to the terminal using the following commands
mkdir task-manager-app
cd task-manager-app
Step 2: Create a new React app using Create React App.
npx create-react-app client
cd client
Step 3: Install the required dependencies.
npm install @apollo/client graphql
Project Structure:
The updated dependencies in package.json file will look like :
Frontend Dependencies:
"dependencies":{
"react":"18.2.0",
"@apollo/client": "3.8.8",
"@apollo/react-hooks": "4.0.0",
"react-dom": "18.2.0",
"graphql": "16.8.11"
}
Backend Dependencies
"dependencies": {
"express": "4.18.2",
"express-graphql": "0.12.0",
"graphql": "15.8.0",
"cors": "2.8.5",
"apollo-server-express": "3.13.0"
}
Example: Add the following code in client/src/App.js
Now the Frontend of the app is ready and we are moving forward to the backand of the app.
Step 4: In the main project directory, create a new file named server.js for the Express server.
npm init -y
touch server.js
Step 5: Install the required dependencies for Express and GraphQL using below command :
npm install express express-graphql graphql corsExample: Now, copy and paste the following code into server.js:
Step 6: Run and Test the App
Backend:
node server.js
Frontend:
cd client
npm start