afriTwi project is an API for rural economy .Many creatives in rural kenya lack access to the market due to limited infrastructure and heavy taxes.AfriTawi acts as a market since it connects rural creatives to the market.afriTawi tech stack consists of Javascript, node.js, express.js and mongoDB.
````md
# AfriTawi API
AfriTawi is a modern marketplace API platform built to empower local creatives, rural artisans, designers, and sellers in Kenya by allowing them to showcase and market their products online.
---
# Features
## Authentication
- User Registration
- Email Verification
- Login & Logout
- JWT Authentication
- Refresh Tokens
- Forgot Password
- Reset Password
- Role-Based Authorization
## Product Management
- Create Products
- Update Products
- Delete Products
- Product Search
- Filtering
- Pagination
- Product Ownership Validation
- Cloudinary Image Uploads
## Profile Management
- Seller Profiles
- Public Seller Pages
- County Assignment
- Avatar Uploads
## Admin Features
- Category Management
- County Management
- Audit Logging
- User Monitoring
---
# Tech Stack
## Backend
- Node.js
- Express.js
- PostgreSQL
- Sequelize ORM
## Authentication
- JWT
- bcrypt
## Media Storage
- Cloudinary
## Documentation
- Swagger / OpenAPI
---
# Database Relationships
## User & Profile
- User hasOne Profile
- Profile belongsTo User
## County & Profile
- County hasMany Profiles
- Profile belongsTo County
## User & Product
- User hasMany Products
- Product belongsTo User
## Category & Product
- Category hasMany Products
- Product belongsTo Category
---
# Installation
## Clone Repository
```bash
git clone
cd afritawi-api
````
## Install Dependencies
```bash
npm install
```
## Environment Variables
Create a `.env` file:
```env
PORT=4545
DB_NAME=creatives
DB_USER=postgres
DB_PASSWORD=yourpassword
DB_HOST=localhost
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_secret
EMAIL_USER=your_email
EMAIL_PASS=your_email_password
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
```
---
# Run Server
## Development
```bash
npm run dev
```
## Production
```bash
npm start
```
---
# API Documentation
Swagger Documentation:
```bash
localhost
```
---
# Aut …