Thank you for your interest in contributing to the Sierra Leone Business Directory! We welcome contributions from the community to help improve business verification and transparency in Sierra Leone.
This document provides guidelines and instructions for contributing to this project.
- Node.js: v20.x or higher
- pnpm: v9.x or higher (we use pnpm for dependency management)
- PostgreSQL: A running PostgreSQL instance (local or cloud like Neon/Supabase)
-
Fork and Clone Fork the repository to your GitHub account and clone it locally:
git clone https://github.com/Walon-Foundation/business-directory.git cd business-directory -
Install Dependencies
pnpm install
-
Environment Setup Copy the example environment file:
cp .env.example .env
Update
.envwith your database credentials:DATABASE_URL="postgresql://user:password@localhost:5432/business_directory"
-
Database Setup Initialize the database schema and seed sample data:
pnpm db:push pnpm db:seed
-
Start Development Server
pnpm dev
The app will be available at http://localhost:3000.
app/: Next.js App Router pages and API routes.api/: Backend API endpoints.explore/: Main business browsing pages.
components/: React components.ui/: Reusable UI components (shadcn/ui).
db/: Database configuration and Drizzle ORM schemas.lib/: Utility functions, environment validation, and shared logic.public/: Static assets.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- UI Library: shadcn/ui + Radix UI
- Database: PostgreSQL + Drizzle ORM
- Validation: Zod
- Linting/Formatting: Biome
-
TypeScript:
- Use strict type safety. Avoid
anywhenever possible. - Define interfaces/types for all props and API responses.
- Use strict type safety. Avoid
-
Components:
- Use functional components with hooks.
- Keep components small and focused.
- Place reusable components in
components/uiorcomponents/shared. - Use
lucide-reactfor icons.
-
Styling:
- Use Tailwind CSS utility classes.
- Avoid inline styles.
- Use
cn()utility for conditional class merging. - Follow the existing design system (colors, spacing).
-
Database:
- Define schemas in
db/schema.ts. - Use Drizzle ORM for all database queries.
- Never commit
.envfiles.
- Define schemas in
-
Code Quality:
- We use Biome for linting and formatting.
- Run
pnpm formatbefore committing to ensure code style consistency. - Run
pnpm lintto catch potential errors.
If you modify the database schema (db/schema.ts):
- Generate migrations (if using migrations workflow) or push changes:
pnpm db:push
- If adding new tables/fields, consider updating
db/seed.tsto include sample data.
The project integrates with the Wasender API to provide business verification via WhatsApp.
- The webhook handler is located at
app/api/webhook/route.ts. - If you are working on WhatsApp features, refer to
SETUP.md - You can test the webhook locally using tools like
ngrokto expose your local server.
-
Create a Branch Create a new branch for your feature or bugfix:
git checkout -b feature/my-new-feature # or git checkout -b fix/bug-description -
Make Changes Implement your changes, adhering to the coding standards.
-
Verify Changes
- Ensure the app builds:
pnpm build - Check for linting errors:
pnpm lint - Format code:
pnpm format
- Ensure the app builds:
-
Commit Write clear, descriptive commit messages. We recommend following Conventional Commits:
feat: add whatsapp integrationfix: resolve complaint form validation errordocs: update readme
-
Push and Pull Request Push your branch to your fork and open a Pull Request (PR) against the
mainbranch of the original repository.- Provide a clear description of your changes.
- Link to any relevant issues.
- Attach screenshots for UI changes.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Be respectful and constructive.
If you have questions or need help, please open an issue or contact the maintainers.
Happy Coding! 🚀