Skip to content

SiddharthKumar268/Anugrah

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎁 Anugrah

Version Node License Status

Give with Grace β€” Share Joy, Spread Kindness πŸ’

A responsive donation platform connecting donors with communities

πŸš€ Features β€’ πŸ“– Setup β€’ πŸ› οΈ Tech Stack β€’ πŸ“‘ API


🌟 About Anugrah

Anugrah (Sanskrit: ΰ€…ΰ€¨ΰ₯ΰ€—ΰ₯ΰ€°ΰ€Ή - meaning grace or blessing) is a full-stack donation platform that allows users to donate items by submitting a form with item details, images, and location information. Built with session-based authentication and real-time form validation.

πŸš€ Features

πŸ“¦ Core Features

  • πŸ“ Donate items with description
  • πŸ“Έ Optional image upload
  • πŸ“ Auto-location via Geolocation API
  • βœ… Real-time form validation
  • πŸ”„ No page reload (AJAX)
  • πŸ—ƒοΈ MongoDB storage

πŸ” Security & UX

  • πŸ”’ Session-based authentication
  • πŸͺ Cookie storage
  • πŸšͺ Logout functionality
  • πŸ“± Responsive design
  • 🎨 Clean UI
  • ⚑ Fast performance

πŸ› οΈ Tech Stack

Frontend

HTML5 CSS3 JavaScript jQuery

Backend

Node.js Express.js MongoDB Mongoose

Additional Tools

Multer Express Session AJAX

βš™οΈ Setup Instructions

πŸ“‹ Prerequisites

βœ“ Node.js >= 14.0.0
βœ“ MongoDB (local or Atlas)
βœ“ npm

πŸš€ Installation

# 1️⃣ Clone the repository
git clone https://github.com/yourusername/anugrah.git
cd anugrah

# 2️⃣ Install dependencies
npm install

# 3️⃣ Setup environment variables (if applicable)
# Create .env file with:
MONGO_URI=your_mongodb_connection_string
SESSION_SECRET=your_secret_key

# 4️⃣ Start the server
node server.js

# 5️⃣ Open in browser
# Visit http://localhost:5000

πŸ“ Project Structure

anugrah/
β”‚
β”œβ”€β”€ πŸ“‚ public/
β”‚   β”œβ”€β”€ donation.css              # Main stylesheet
β”‚   β”œβ”€β”€ donor.png                 # Favicon/icon
β”‚   └── home.html                 # Home page
β”‚
β”œβ”€β”€ πŸ“‚ views/
β”‚   └── donate.html               # Donation form
β”‚
β”œβ”€β”€ πŸ“‚ uploads/                   # Uploaded images
β”‚
β”œβ”€β”€ πŸ“‚ models/
β”‚   └── Donor.js                  # Mongoose schema
β”‚
β”œβ”€β”€ πŸ“„ server.js                  # Main server file
β”œβ”€β”€ πŸ“„ package.json               # Dependencies
└── πŸ“„ README.md                  # Documentation

πŸ“‘ API Endpoints

Method Endpoint Description Auth Required
GET / Serve home page ❌
GET /donate Serve donation form βœ…
POST /donor Handle form submission (with image and location) βœ…
GET /logout Destroy session and log out user βœ…

πŸ—„οΈ Database Schema

{
  item: String,               // Item name/title
  description: String,        // Detailed description
  latitude: Number,           // Geographic latitude
  longitude: Number,          // Geographic longitude
  imagePath: String,          // Path to uploaded image
  timestamp: {                // Auto-generated timestamp
    type: Date, 
    default: Date.now 
  }
}

πŸ§ͺ Testing

Testing Checklist

  • βœ… Submit valid form entries
  • βœ… Submit invalid entries (test validation)
  • βœ… Grant location permission
  • βœ… Deny location permission
  • βœ… Upload supported image formats (.jpg, .png)
  • βœ… Verify data saved to MongoDB
  • βœ… Test session authentication
  • βœ… Test logout functionality

πŸ“· Screenshots Gallery

🏠 Home Page

Clean landing page with easy navigation

Home Page


πŸ“ Donation Form

Intuitive form with real-time validation

Donation Form 1

Donation Form 2

Donation Form 3


πŸ“Έ Image Upload & Details

Easy image upload with preview

Upload 1

Upload 2

Upload 3


πŸ“ Location Tracking

Automatic location detection

Location 1

Location 2


βœ… Form Submission

Success confirmations and feedback

Success 1

Success 2

Success 3


πŸ” Authentication

Secure login and session management

Auth 1

Auth 2

Auth 3


πŸ“± Responsive Design

Works perfectly on all devices

Mobile 1

Mobile 2

Mobile 3


🎨 UI Elements

Beautiful and functional interface

UI 1

UI 2

🀝 Contributing

Contributions are welcome! Here's how:

# Fork the repository
# Create your feature branch
git checkout -b feature/AmazingFeature

# Commit your changes
git commit -m 'Add some AmazingFeature'

# Push to the branch
git push origin feature/AmazingFeature

# Open a Pull Request

πŸ™Œ Acknowledgements

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

[Your Name]

GitHub LinkedIn Email

πŸ’– Support

If this project helped you, please consider giving it a ⭐️!

Thanks

Built with πŸ’š | Made with ❀️ for Communities

⬆ Back to Top

About

A responsive donation form page that allows users to submit item details along with their location and an image, with authentication and logout functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors