- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
xfraga/homeless-report
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
| Β  | Β  | |||
| Β  | Β  | |||
| Β  | Β  | |||
| Β  | Β  | |||
Repository files navigation
# Homeless Report System
A web application for reporting and tracking homeless individuals to help connect them with support services. This system allows community members to submit reports with location data, health status, and urgency level, making it easier for social services to respond effectively.
## π Project Overview
The Homeless Report System consists of:
- **Frontend**: A user-friendly web interface for submitting and viewing reports
- **Backend**: A RESTful API server for managing report data
- **In-memory storage**: Simple data persistence (can be upgraded to a database)
## π Features
- β
 Submit reports with location, GPS coordinates, health status, and urgency level
- β
 Automatic geolocation support using browser GPS
- β
 Real-time report viewing with color-coded urgency levels
- β
 Responsive design for mobile and desktop
- β
 RESTful API for report management
- β
 Filter reports by urgency and status
- β
 Statistics dashboard
## π Project Structure
```
homeless-report/
βββ backend/
β   βββ server.js          # Express.js API server
βββ frontend/
β   βββ index.html         # Main HTML page
β   βββ style.css          # Styling
β   βββ main.js            # Frontend JavaScript logic
βββ README.md              # This file
```
## π οΈ Installation
### Prerequisites
- Node.js (v14 or higher)
- npm (Node Package Manager)
### Backend Setup
1. Navigate to the backend directory:
   ```bash
   cd backend
   ```
2. Install dependencies:
   ```bash
   npm install express cors
   ```
3. Start the backend server:
   ```bash
   node server.js
   ```
   The server will start on `http://localhost:3000`
### Frontend Setup
1. Navigate to the frontend directory:
   ```bash
   cd frontend
   ```
2. Serve the frontend using any HTTP server. Options include:
   **Option 1: Using Python**
   ```bash
   # Python 3
   python -m http.server 8080
   
   # Python 2
   python -m SimpleHTTPServer 8080
   ```
   **Option 2: Using Node.js http-server**
   ```bash
   npx http-server -p 8080
   ```
   **Option 3: Using VS Code Live Server extension**
   - Install the "Live Server" extension in VS Code
   - Right-click on `index.html` and select "Open with Live Server"
3. Open your browser and navigate to:
   ```
   http://localhost:8080
   ```
## π API Documentation
### Base URL
```
http://localhost:3000/api
```
### Endpoints
#### Health Check
```http
GET /api/health
```
Returns server health status and total report count.
#### Get All Reports
```http
GET /api/reports
```
Query Parameters:
- `urgency` (optional): Filter by urgency level (high, medium, low)
- `status` (optional): Filter by health status
- `limit` (optional): Limit number of results
#### Get Single Report
```http
GET /api/reports/:id
```
Returns a specific report by ID.
#### Create Report
```http
POST /api/reports
```
Request Body:
```json
{
  "location": "123 Main St, City",
  "latitude": "40.7128",
  "longitude": "-74.0060",
  "status": "minor_concern",
  "urgency": "medium",
  "description": "Person appears to need medical attention",
  "reporterName": "John Doe",
  "reporterContact": "[email protected]"
}
```
#### Update Report
```http
PUT /api/reports/:id
```
Request body: Same as POST
#### Delete Report
```http
DELETE /api/reports/:id
```
Deletes a specific report.
#### Get Statistics
```http
GET /api/stats
```
Returns aggregated statistics about all reports.
## π¨ Usage
### Submitting a Report
1. Fill out the form with:
   - Location or address
   - GPS coordinates (or click "Get Current Location")
   - Health status
   - Urgency level
   - Additional details
   - Your contact information (optional)
2. Click "Submit Report"
3. The report will appear in the "Recent Reports" section
### Viewing Reports
Reports are displayed with color-coded urgency levels:
- π΄ **Red**: High urgency - Immediate help required
- π‘ **Yellow**: Medium urgency - Needs assistance
- π’ **Green**: Low urgency - Informational
## π§ Configuration
### Backend Configuration
Edit `backend/server.js` to change:
- Port number (default: 3000)
- CORS settings
- Data storage (switch to database)
### Frontend Configuration
Edit `frontend/main.js` to change:
- API URL (line 2)
- Form validation rules
- UI behavior
## π Deployment
### Backend Deployment
**Heroku:**
```bash
heroku create homeless-report-api
git push heroku main
```
**Other platforms:** Deploy as a standard Node.js application
### Frontend Deployment
**GitHub Pages / Netlify / Vercel:**
- Deploy the `frontend` folder
- Update `API_URL` in `main.js` to point to your deployed backend
## π Security Considerations
β οΈ  **Important**: This is a development version with in-memory storage.
For production use:
1. Add authentication and authorization
2. Implement rate limiting
3. Add input validation and sanitization
4. Use a proper database (PostgreSQL, MongoDB)
5. Implement HTTPS
6. Add data encryption for sensitive information
7. Implement logging and monitoring
## π€ Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
## π Future Enhancements
- [ ] Database integration (PostgreSQL/MongoDB)
- [ ] User authentication system
- [ ] Interactive map view of reports
- [ ] Email notifications to authorities
- [ ] Mobile app (React Native)
- [ ] Admin dashboard
- [ ] Report status updates
- [ ] Photo upload capability
- [ ] Integration with social services APIs
## π License
MIT License - Feel free to use this project for humanitarian purposes.
## π Support
For issues or questions:
- Open an issue on GitHub
- Contact: [Your contact information]
## π Acknowledgments
This project was created to help connect homeless individuals with support services and improve community response efforts.
---
**Remember**: Always approach homeless individuals with respect and dignity. This tool is meant to facilitate help, not surveillance.About
        No description, website, or topics provided.
      
    Resources
Stars
Watchers
Forks
Releases
No releases published
              Packages 0
        No packages published