Prerequisites
Before you begin, ensure you have the following installed:- Node.js v18 or higher
- MongoDB v4.4 or higher (running locally or accessible remotely)
- npm or yarn package manager
- Git (for cloning the repository)
This quickstart guide will get you up and running with default settings. For production deployments or advanced configuration, see the installation guide.
Quick setup
Install backend dependencies
Install the required Node.js packages for the backend:This installs Express.js, MongoDB, JWT, and other backend dependencies.
Configure environment variables
Create a
.env file in the backend directory with your configuration:.env
The
WEB3FORMS_ACCESS_KEY is optional for development. Get a free key at web3forms.com to enable email settlement summaries.Start MongoDB
Ensure MongoDB is running on your system. If you have MongoDB installed locally:
You can also use MongoDB Atlas (cloud) by updating the
MONGODB_URI in your .env file with your Atlas connection string.Start the backend server
Launch the Express.js backend server:You should see:The backend API is now running at
http://localhost:5000.Install frontend dependencies
Open a new terminal window and install the React frontend dependencies:This installs React, Material-UI, Axios, and other frontend dependencies.
Start the frontend development server
Launch the Vite development server for the React frontend:The frontend will be available at
http://localhost:5173.Verify your installation
To confirm everything is working correctly:- Test user registration: Click “Sign Up” and create a new account
- Create a group: Navigate to “Groups” and create your first expense group
- Add an expense: Add a test expense to your group
- Check balances: Verify that balances are calculated correctly
What’s next?
API reference
Explore all available API endpoints and learn how to integrate with BillBuddy.
Detailed installation
Learn about advanced configuration options and production setup.
Authentication
Understand how JWT authentication works in BillBuddy.
Configuration
Configure environment variables and settings for your deployment.
Troubleshooting
Port already in use
If port 5000 or 5173 is already in use, you can change the ports:- Backend: Update
PORTin your.envfile - Frontend: Vite will automatically try the next available port, or you can specify one in
vite.config.js
MongoDB connection error
If you see “MongoDB connection error”:- Verify MongoDB is running:
mongosh(should connect successfully) - Check your
MONGODB_URIin the.envfile - Ensure the MongoDB port (default 27017) is not blocked
CORS errors
If you encounter CORS errors:- Verify the backend is running on port 5000
- Check that the frontend is running on port 5173
- The backend CORS configuration in
server.js:30-37allows these origins by default
Running both servers concurrently
For convenience during development, you can run both servers with a single command from the backend directory:concurrently to run both the backend and frontend development servers simultaneously.