A community-driven map application designed to help Muslims find and add mosques (Masajid) in their region. This project leverages OpenStreetMap to provide an interactive and accessible platform for the community.
- Interactive Map: View mosques in your area using an OpenStreetMap-powered interface.
- Add & Edit Places: Community members can add new mosques or update existing information.
- Verification System: Users can rate and verify the reputation of locations (VERIFIED or FAKE) to ensure data accuracy.
- Multilingual Support: Supports both Arabic and English names for locations.
- User Authentication: Secure sign-in via Google.
- Responsive Design: Optimized for both desktop and mobile devices using Tailwind CSS.
- Framework: Next.js 14
- Language: TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- Mapping: OpenStreetMap, Leaflet, React Leaflet
- Styling: Tailwind CSS, Shadcn UI
- Validation: Zod
- Node.js (Latest LTS recommended)
- pnpm (Preferred package manager)
- A PostgreSQL database instance
- Google Cloud Console project for OAuth credentials
-
Clone the repository:
git clone https://github.com/your-username/nextjs-osm.git cd nextjs-osm -
Install dependencies:
pnpm install
-
Configure Environment Variables: Create a
.env.dev.localfile in the root directory and add the following variables:# Database DATABASE_URL="postgresql://user:password@localhost:5432/nextjs_osm?schema=public" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-nextauth-secret" # Google OAuth GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # Optional PREVIEW_API_KEY="your-preview-api-key"
DATABASE_URL: Your PostgreSQL connection string.NEXTAUTH_SECRET: A random string used to hash tokens. You can generate one usingopenssl rand -base64 32.GOOGLE_CLIENT_ID&GOOGLE_CLIENT_SECRET: Obtain these from the Google Cloud Console by creating OAuth 2.0 credentials.
-
Database Setup: Generate the Prisma client and run migrations:
pnpm run prepare pnpm run migrate
-
Run the Development Server:
pnpm run dev
Open http://localhost:3000 in your browser to see the result.
pnpm run dev: Starts the development server.pnpm run build: Builds the application for production.pnpm run start: Starts the production server.pnpm run lint: Runs ESLint for code quality checks.pnpm run studio: Opens Prisma Studio to explore your database.
Contributions are welcome! If you're interested in improving the app, feel free to fork the repository and submit a pull request.
This project is private. (Adjust as necessary based on project requirements).