(Just a random college assignment done for grades. Want more innovative projects ? roam around my GitHub account)
A comprehensive application for mapping and analyzing infrastructure distribution across India, including schools, hospitals, water resources, and power stations.
- Interactive map visualization with resource filters
- Admin dashboard with statistics and charts
- Resource management system (add, edit, delete)
- Dark theme design for better visibility
- Mobile responsive layout
-
Requirements:
- PHP 7.4 or higher
- MySQL database
- Web server (Apache, Nginx)
-
Setup:
- Upload all files to your web hosting
- Create a MySQL database using the structure in
database.sql - Update database connection details in
php/config.php:$servername = "your-database-server"; $username = "your-database-username"; $password = "your-database-password"; $dbname = "your-database-name";
-
Recommended Hosting Providers:
- InfinityFree - Free PHP hosting
- 000webhost - Free hosting with PHP and MySQL
- Hostinger - Affordable paid hosting
- XAMPP/WAMP/MAMP:
The application includes Docker configuration for easy deployment:
-
Prerequisites:
-
Launch the application:
docker-compose up -d
-
Access the application:
- Web application: http://localhost:8080
- phpMyAdmin: http://localhost:8081 (user: smartuser, password: smartpass)
-
Heroku:
- Create a Heroku account
- Install Heroku CLI
- Create a new Heroku app:
heroku create smartindiamapping - Add a MySQL addon:
heroku addons:create cleardb:ignite - Get database URL:
heroku config | grep CLEARDB_DATABASE_URL - Update
php/config.phpwith the database credentials from the URL - Deploy to Heroku:
git push heroku main
-
Railway or Render:
- These platforms offer free PHP and MySQL hosting
- Follow their deployment documentation for PHP applications
The database structure is defined in database.sql. Key tables include:
resources_schools- School dataresources_hospitals- Hospital dataresources_water- Water resource dataresources_electricity- Power station datausers- Admin user accountsactivity_log- User action logsregions- Region/state information
The PHP backend provides these key endpoints:
php/get_dashboard_data.php- Returns summary statisticsphp/get_resources.php- Returns resources filtered by type and regionphp/delete_resource.php- Deletes a specified resourcephp/upload.php- Adds or updates resource dataphp/login.php- Handles user authenticationphp/logout.php- Handles user logout
The application's frontend is built with HTML, CSS (via TailwindCSS), and JavaScript:
index.html- Landing pagemap.html- Interactive map interfaceadmin.html- Admin dashboard
- Ensure your web hosting provider supports HTTPS
- Keep PHP and MySQL updated to the latest versions
- Consider implementing a .htaccess file for additional security
- Set appropriate file permissions (typically 755 for directories, 644 for files)
-
Database Connection Issues:
- Verify database credentials in
php/config.php - Check if MySQL service is running
- Ensure your hosting supports the MySQL version you're using
- Verify database credentials in
-
File Permissions:
- Make sure PHP has write access to directories where uploads occur
- Check error logs for permission-related issues
-
API Not Working:
- Enable error reporting temporarily to identify issues:
ini_set('display_errors', 1); error_reporting(E_ALL);
- Check browser console for AJAX errors
- Verify PHP version compatibility
- Enable error reporting temporarily to identify issues:
For additional support, please open an issue on the GitHub repository.
This project is available for open use.