Skip to content

Cleaned project structure and configured root gitignore#57

Open
Niya2201 wants to merge 1 commit into
MeenakshiAM:mainfrom
Niya2201:backend
Open

Cleaned project structure and configured root gitignore#57
Niya2201 wants to merge 1 commit into
MeenakshiAM:mainfrom
Niya2201:backend

Conversation

@Niya2201
Copy link
Copy Markdown

📌 Description

This PR converts the Expense Tracker from a frontend-only application using localStorage into a full-stack application with a backend and persistent cloud database storage.

A Node.js + Express backend has been implemented and connected to MongoDB Atlas using Mongoose. The frontend now communicates with the backend using REST API calls instead of localStorage.


🔗 Related Issue

Closes #50


🛠 Changes Made

  • Created backend using Node.js and Express
  • Integrated MongoDB Atlas for persistent storage
  • Implemented REST API endpoints:
    • POST /expenses → Add new expense
    • GET /expenses → Fetch all expenses
    • DELETE /expenses/:id → Delete expense
  • Connected backend to MongoDB using Mongoose
  • Replaced localStorage logic with fetch() API calls
  • Added environment variable support using .env
  • Configured proper .gitignore to exclude node_modules and .env

📷 Screenshots (if applicable)

  • Backend running successfully on port 5000
  • MongoDB Atlas showing saved expense documents
  • Frontend successfully adding and fetching expenses from database

Screenshot 2026-02-26 200552

✅ Checklist

  • I have tested my changes
  • My code follows project guidelines
  • I have linked the related issue

@MeenakshiAM
Copy link
Copy Markdown
Owner

I noticed that the MongoDB connection URL has been committed directly into the code. For security reasons, sensitive information like database URLs should never be exposed publicly in the repository.

Please move the MongoDB URL into an .env file and access it using environment variables (for example, process.env.MONGO_URI). Also make sure to remove the exposed URL from the current commit history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Basic Bckend

2 participants