Find pharmacies across Tunisia, check their working hours, and get real-time information about available medications and services. Join our network of verified pharmacies.
# Pharmacy Finder Tunisia
A modern web application to help users find nearby pharmacies in Tunisia, with real-time information about opening hours and availability.
## Features
- 🗺️ Interactive map view of pharmacies
- 📍 Real-time location-based search
- ⏰ Filter by opening hours and night shift availability
- 📱 Responsive design for mobile and desktop
- 🔍 Search by location or pharmacy name
- 🌙 Night shift pharmacy indicators
## Tech Stack
- Next.js 14 with App Router
- TypeScript
- Tailwind CSS
- Supabase for backend
- Mapbox for maps
- React Map GL for map interactions
## Getting Started
1. Clone the repository:
```bash
git clone
cd pharmacy-finder
```
2. Install dependencies:
```bash
npm install
```
3. Create a `.env.local` file in the root directory with the following variables:
```env
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_token
```
4. Start the development server:
```bash
npm run dev
```
5. Open
localhost with your browser to see the result.
## Supabase Database Schema
The application uses the following table structure in Supabase:
```sql
create table pharmacies (
id uuid default uuid_generate_v4() primary key,
name text not null,
address text not null,
coordinates geometry(Point, 4326) not null,
is_open boolean default false,
opening_hours text not null,
closing_hours text not null,
is_night_shift boolean default false,
phone_number text,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
updated_at timestamp with time zone default timezone('utc'::text, now()) not null
);
-- Enable RLS
alter table pharmacies enable row level security;
-- Create policies
create policy "Enable read access for all users" on pharmacies for select using (true);
create policy "Enable insert for authenticated users only" on pharmacies for insert with check (auth.role() = 'authenticated');
create policy "Enable update for pharm …