Disaster-inventory

Incident Map is a web application that visualizes incidents on an interactive map of India. Users can filter incidents by state, month, and year, making it easier to analyze and track data over time. Built with Next.js, TypeScript, Prisma, TailwindCSS, and MongoDB, this project showcases a full-stack implementation of modern web technologies.

MIT License

Stars
3

Landslides Map

Incident Map is a web application that visualizes incidents on a map, allowing users to filter incidents by state, month, and year. The project is built using Next.js, TypeScript, Prisma, TailwindCSS, and MongoDB.

Table of Contents

Features

  • Display incidents on an interactive map.
  • Filter incidents by state, month, and year.
  • Responsive design using TailwindCSS.
  • Full-stack implementation using Next.js and Prisma with MongoDB.

Tech Stack

  • Next.js: React framework for server-rendered applications.
  • TypeScript: Typed JavaScript for better code quality and developer experience.
  • Prisma: ORM (Object-Relational Mapping) for connecting to MongoDB.
  • MongoDB: NoSQL database for storing incident data.
  • TailwindCSS: Utility-first CSS framework for styling.
  • Vercel: For Deployment.

Setup Instructions

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: Version 14 or higher.
  • npm or yarn: Latest version.
  • MongoDB: A running instance of MongoDB.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/incident-map.git
    cd incident-map
    
  2. Install dependencies:

    Using npm:

    npm install
    

    Using yarn:

    yarn install
    
  3. Set up the database:

    Use Prisma to set up the MongoDB database.

    npx prisma migrate dev --name init
    

    This command applies any migrations and sets up your MongoDB schema.

Environment Variables

Create a .env file in the root directory and add the following environment variables:

DATABASE_URL="mongodb+srv://<username>:<password>@cluster0.mongodb.net/<database-name>?retryWrites=true&w=majority"

  • DATABASE_URL: Your MongoDB connection string.

Running the Project

To run the project locally, use the following command:

npm run dev

Or, if you're using yarn:

yarn dev

This command starts the Next.js development server on http://localhost:3000.

Contributing

Contributions are welcome! Please fork this repository, create a new branch, and submit a pull request.

Steps to Contribute

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature-name
    
  3. Make your changes.
  4. Commit your changes:
    git commit -m "Add feature: your feature name"
    
  5. Push to the branch:
    git push origin feature/your-feature-name
    
  6. Open a pull request.

License

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

Related Projects