A full-stack project management application built with the MERN stack and GraphQL. The app allows users to manage clients and projects, supporting features like adding, updating, and deleting both clients and projects. This application uses Apollo Client on the frontend to interact with a GraphQL API on the backend.
- Manage clients and projects with a clear interface.
- Add, update, and delete clients and projects.
- View project details, including the client associated with each project.
- Organized into frontend (React) and backend (Node.js/Express/GraphQL) with clear separation.
- React 18.3.1
- Apollo Client 3.6.6 for GraphQL integration
- React Router DOM 6.3.0 for navigation
- Node.js 20.11.0 and Express 4.18.1 for server-side development
- Express-GraphQL 0.12.0 for GraphQL API handling
- Mongoose 7.0.0 for MongoDB object modeling
- GraphQL 15.8.0
- Node.js and npm
- MongoDB instance or Atlas cloud database
- Clone this repository and navigate to the project folder.
-
Navigate to the
client
directory:cd client
-
Install the dependencies:
npm install
-
Start the frontend application:
npm start
-
Navigate to the
server
directory:cd server
-
Install the dependencies:
npm install
-
Create a
.env
file in theserver
directory with the following variables:MONGO_URI=<Your MongoDB URI>
-
Start the backend server in development mode:
npm run dev
The backend will start on http://localhost:5000
and expose the GraphQL endpoint at http://localhost:5000/graphql
.
The React frontend allows users to navigate between different sections of the app, view client and project details, and interact with the GraphQL API through Apollo Client.
- Routes
/
: Home page listing all clients and projects./projects/:id
: Detailed view of a single project.*
: 404 Not Found page for undefined routes.
The Express server handles the GraphQL API for managing clients and projects.
The schema defines the following types:
- ClientType: Represents a client with fields for
id
,name
,email
, andphone
. - ProjectType: Represents a project with fields for
id
,name
,description
,status
, and a reference toClientType
.
These are the GraphQL queries and mutations available:
{
clients {
name
}
}
{
client(id: 1) {
name
email
}
}
{
projects {
name
status
}
}
{
project(id: 1) {
name
description
client {
name
email
}
}
}
mutation {
addClient(
name: "Tony Stark"
email: "ironman@gmail.com"
phone: "955-365-3376"
) {
id
name
email
phone
}
}
mutation {
deleteClient(id: 1) {
id
}
}
mutation {
addProject(
name: "Mobile App"
description: "This is the project description"
status: "new"
clientId: "1"
) {
name
description
}
}
mutation {
updateProject(status: "completed") {
name
status
}
}