A mobile application for reporting and tracking community issues in Tunisia. Users can report problems such as broken infrastructure, potholes, and more. The community can upvote issues to highlight priorities.
# TunisiaFixIt
A mobile application for reporting and tracking community issues in Tunisia. Users can report problems such as broken infrastructure, potholes, and more. The community can upvote issues to highlight priorities.
## Features
- Report issues with photos and location
- Browse existing issues
- Filter issues by category
- Search functionality
- Upvote important issues
- Track issue status (pending, in progress, completed)
## Technologies
- React Native / Expo
- Supabase (PostgreSQL database)
- React Navigation
- Expo Camera, Location and ImagePicker
## Setup Instructions
### Prerequisites
- Node.js (v14 or newer)
- npm or yarn
- Expo CLI
- Supabase account
### Database Setup
1. Create a new Supabase project
2. Run the following SQL in your Supabase SQL Editor:
```sql
CREATE TABLE issues (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title TEXT NOT NULL,
description TEXT NOT NULL,
location TEXT NOT NULL,
status TEXT NOT NULL CHECK (status IN ('pending', 'in_progress', 'completed')),
date_reported TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
category TEXT NOT NULL,
upvotes INTEGER DEFAULT 0,
image_url TEXT,
latitude FLOAT,
longitude FLOAT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Enable Row Level Security
ALTER TABLE issues ENABLE ROW LEVEL SECURITY;
-- Create a policy that allows all users to read issues
CREATE POLICY "Anyone can read issues" ON issues FOR SELECT USING (true);
-- Create a policy that allows authenticated users to insert issues
CREATE POLICY "Authenticated users can insert issues" ON issues FOR INSERT
WITH CHECK (true);
-- Create a policy that allows users to update their own issues
CREATE POLICY "Users can update their own issues" ON issues FOR UPDATE
USING (true);
```
### Environment Setup
1. Clone the repository
2. Install dependencies:
```
npm install
```
3. Create a `.env` file in the root directory and add your Supabase credentials:
```
EXPO_PUBLIC_SUPABASE_URL=your_supabase_url
EXPO_PUBLIC_SUPABASE_KEY=y …