This is a simple Expense Tracker built with the MERN stack (MongoDB, Express, React, Node.js).
- Learn how to set up a backend server with Express and Node.js.
- Connect the server to a MongoDB database using Mongoose.
- Create a RESTful API to handle expense data (CRUD operations).
- Build a frontend with React and Vite to interact with the backend API.
- server/: The backend API built with Express and Node.js.
models/: Database schemas (using Mongoose).routes/: API endpoints.index.js: Server entry point.
- client/: The frontend built with React and Vite.
src/components/: Reusable React components.App.jsx: Main application logic and state management.
- Backend:
- Node.js
- Express.js
- MongoDB with Mongoose
- Frontend:
- React.js
- Vite
- Axios for API calls
- Node.js installed.
- A MongoDB Atlas cluster (or a local MongoDB instance).
- Go to the
serverfolder:cd server - Install dependencies:
npm install - Create a
.envfile (copied from the template) and add your MONGO_URI. - Start the server:
npm start- The server runs on
http://localhost:5001.
- The server runs on
- Go to the
clientfolder:cd client - Install dependencies:
npm install - Start the development server:
npm run dev- The app will be available at the URL shown in your terminal (usually
http://localhost:5173).
- The app will be available at the URL shown in your terminal (usually
- Backend: Setting up an Express server, connect to MongoDB using Mongoose, and create RESTful API routes.
- Frontend: Creating functional React components, manage state with
useStateanduseEffect, and perform API calls using Axios. - Full Stack: How the frontend communicates with the backend to perform CRUD (Create, Read, Update, Delete) operations.
This project is designed for learning purposes and does not include authentication.
Supakorn P. GitHub