This guide will help you set up the AbbasiConnect development environment on your local machine.
Before you begin, ensure you have the following installed:
- Node.js 18.x or higher (Download)
- npm 9.x or higher (comes with Node.js)
- Git (Download)
- A Supabase account (Sign up)
- A Brevo or Resend account for email (Brevo | Resend)
git clone <repository-url>
cd abbasiconnectInstall all project dependencies:
npm installThis will install dependencies for all workspaces (root, web app, and packages).
- Go to Supabase Dashboard
- Click "New Project"
- Fill in the details:
- Name: AbbasiConnect
- Database Password: Choose a strong password (save it securely)
- Region: Choose closest to your target users
- Click "Create new project"
Once your project is created:
- Go to Settings → API
- Copy the following:
- Project URL (e.g.,
https://xxxxx.supabase.co) - anon/public key (starts with
eyJ...) - service_role key (starts with
eyJ...) - Keep this secret!
- Project URL (e.g.,
- Open the Supabase SQL Editor
- Run the schema file:
-- Copy and paste contents of packages/db/schema.sql - Run the RLS policies:
-- Copy and paste contents of packages/db/rls-policies.sql - Run the seed data:
-- Copy and paste contents of packages/db/seed.sql
Alternatively, you can use the Supabase CLI:
# Install Supabase CLI
npm install -g supabase
# Login to Supabase
supabase login
# Link your project
supabase link --project-ref <your-project-ref>
# Run migrations
supabase db pushIn Supabase Dashboard:
- Go to Storage
- Create the following buckets:
avatars(public)posts(public)events(public)help-requests(public)groups(public)
For each bucket:
- Click "New bucket"
- Enter the name
- Set as Public bucket
- Click "Create bucket"
- Sign up at Brevo
- Verify your email
- Go to SMTP & API → API Keys
- Create a new API key
- Copy the API key
- Sign up at Resend
- Verify your email
- Go to API Keys
- Create a new API key
- Copy the API key
For better deliverability:
- Add your domain in the email provider
- Add DNS records (SPF, DKIM, DMARC)
- Verify the domain
For development, you can use the default sender, but for production, use a custom domain.
-
Copy the example environment file:
cp apps/web/.env.example apps/web/.env.local
-
Edit
apps/web/.env.localand fill in your credentials:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGc...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGc...
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=AbbasiConnect
# Email Provider (Brevo)
BREVO_API_KEY=xkeysib-...
BREVO_SENDER_EMAIL=noreply@yourdomain.com
BREVO_SENDER_NAME=AbbasiConnect
# Email Provider (Resend - Optional Fallback)
RESEND_API_KEY=re_...
# Web Push Notifications (Generate these - see below)
NEXT_PUBLIC_VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT=mailto:admin@yourdomain.com
# Security (Generate random strings)
JWT_SECRET=your-jwt-secret-min-32-chars
ENCRYPTION_KEY=your-encryption-key-32-chars
# Feature Flags
ENABLE_PHONE_VERIFICATION=false
ENABLE_WEBAUTHN=true
ENABLE_MATRIMONY=false
ENABLE_DONATIONS=false
# Environment
NODE_ENV=developmentWeb push notifications require VAPID keys:
# Install web-push globally
npm install -g web-push
# Generate VAPID keys
web-push generate-vapid-keys
# Copy the output to your .env.local
# Public Key → NEXT_PUBLIC_VAPID_PUBLIC_KEY
# Private Key → VAPID_PRIVATE_KEYGenerate random strings for JWT and encryption:
# On Linux/Mac
openssl rand -base64 32
# On Windows (PowerShell)
[Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 }))
# Or use Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"Run this twice to generate both JWT_SECRET and ENCRYPTION_KEY.
The seed file includes sample pincode data. For production, you'll need the complete Indian pincode dataset.
The seed file already includes ~40 sample pincodes for major cities. This is sufficient for development.
- Download the complete Indian pincode dataset (CSV format)
- Create a script to import it:
// scripts/import-pincodes.js
const { createClient } = require('@supabase/supabase-js');
const fs = require('fs');
const csv = require('csv-parser');
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.SUPABASE_SERVICE_ROLE_KEY
);
const pincodes = [];
fs.createReadStream('pincodes.csv')
.pipe(csv())
.on('data', (row) => {
pincodes.push({
pincode: row.pincode,
city: row.city,
district: row.district,
state: row.state,
latitude: parseFloat(row.latitude),
longitude: parseFloat(row.longitude),
});
})
.on('end', async () => {
console.log(`Importing ${pincodes.length} pincodes...`);
// Insert in batches of 1000
for (let i = 0; i < pincodes.length; i += 1000) {
const batch = pincodes.slice(i, i + 1000);
const { error } = await supabase.from('pincodes').insert(batch);
if (error) {
console.error('Error:', error);
} else {
console.log(`Imported ${i + batch.length} pincodes`);
}
}
console.log('Import complete!');
});Start the development server:
npm run devThe app will be available at http://localhost:3000
- Open http://localhost:3000
- You should see the AbbasiConnect landing page
- Try signing up with an email
- Check that you receive the OTP email
- Complete the verification
Solution: Run npm install in the root directory
Solution: Check that your .env.local has the correct Supabase URL without trailing slash
Solution:
- Verify your email provider API key
- Check that sender email is verified
- Look at the server logs for detailed error messages
Solution:
- Verify Supabase project is active
- Check that RLS policies are applied
- Ensure service role key is correct
Solution:
- Delete
node_modulesand.nextfolders - Run
npm installagain - Restart the dev server
- Read the API Documentation
- Review the Deployment Guide
- Check the Operations Runbook
- Start building features!
If you encounter issues:
- Check the TODO.md for known issues
- Review the error logs in the terminal
- Check Supabase logs in the dashboard
- Contact the development team
- Use the Supabase Dashboard to inspect database tables
- Enable verbose logging in development
- Use the Network tab to debug API calls
- Test with multiple user accounts
- Keep your
.env.localfile secure and never commit it
Ready to build! 🚀