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.
- Features
- Tech Stack
- Setup Instructions
- Environment Variables
- Running the Project
- Folder Structure
- Contributing
- License
- 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.
- 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.
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.
-
Clone the repository:
git clone https://github.com/your-username/incident-map.git cd incident-map
-
Install dependencies:
Using npm:
npm install
Using yarn:
yarn install
-
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.
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.
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
.
Contributions are welcome! Please fork this repository, create a new branch, and submit a pull request.
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes.
- Commit your changes:
git commit -m "Add feature: your feature name"
- Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.