A full-stack web application built using the MERN stack (MongoDB, Express.js, React.js, Node.js) to manage cricket teams. The application allows users to create, view, update, search, and delete teams.
- Create a Team: Add a new team with players.
- View Teams: Display all teams and their details.
- Search Teams: Search for teams by name.
- Edit Team: Update team details and players.
- Delete Team: Remove a team from the system.
- Frontend: React.js, React Router
- Backend: Node.js, Express.js
- Database: MongoDB (Atlas or Compass)
- Node.js (version 14 or later)
- MongoDB (either MongoDB Atlas for cloud or MongoDB Compass for local)
git clone <repository-url>
cd <repository-directory>
Install dependencies for both frontend and backend:
cd backend
npm install
cd ../frontend
npm install
- Go to MongoDB Atlas and create a cluster.
- Create a database and a collection for teams.
- In the backend folder, create a
.env
file and add the following:
MONGO_URI=<your-mongodb-atlas-cluster-url>
PORT=5000
- Download and install MongoDB Compass.
- Create a local database and a collection for teams.
- In the backend folder, create a
.env
file and add the following:
MONGO_URI=mongodb://localhost:27017/cricket-team-manager
PORT=5000
- In the frontend folder, create a
.env
file and add the following (for environment variables like API URL):
REACT_APP_BACKEND_URL=http://localhost:5000
This will allow the frontend to communicate with the backend when both servers are running locally.
cd backend
npm start
cd frontend
npm run dev
The backend will run on http://localhost:5000
, and the frontend will run on http://localhost:5173
.
/frontend
├── /src
├── App.js
└── /components
/backend
├── /models
├── /routes
├── /controllers
├── server.js
└── .env
This project is licensed under the MIT License.
-
Backend
.env
file:- Contains the
MONGO_URI
for connecting to the MongoDB database (either Atlas or local using Compass). - Also includes the
PORT
for running the backend server.
- Contains the
-
Frontend
.env
file:- Contains
REACT_APP_BACKEND_URL
which is used to define the backend API URL for the frontend to make API requests.
- Contains
Make sure to replace <repository-url>
with your actual GitHub repository URL. This should be ready for you to copy and paste.