Skip to content

Nwokike/Kiriong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

189 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nigerian Artisan Marketplace & Learning Platform

Kiriong Logo

πŸš€ Live Site

Kiriong is a comprehensive Django-based Progressive Web Application (PWA) connecting Nigerian artisans with customers. It features an innovative AI-powered learning academy, a community blog, and intelligent customer service to create a complete ecosystem for artisan growth.


✨ Key Features

  • πŸ›’ Marketplace: Service listings with a booking system, ML-based service recommendations, and artisan dashboards.
  • πŸŽ“ AI Academy: Personalized learning pathways powered by Google Gemini, progress tracking, AI tutoring, and downloadable PDF certificates.
  • πŸ€– AI Customer Service: A 24/7 Gemini-powered chatbot with quick help guides and conversation history.
  • πŸ“ Community Blog: A rich content platform using CKEditor 5 for posts, complete with a commenting system.
  • πŸ”” Real-Time Engagement: In-app notifications and Web Push API for real-time alerts (excluding iOS).
  • 🎨 Modern User Experience: A mobile-first, responsive PWA with a dark/light mode toggle and multi-language support (English, Hausa, Igbo, Yoruba).
  • πŸ‘€ Robust User System: Secure sign-up with reCAPTCHA, Google OAuth, a username-based referral system, and detailed user profiles.

πŸ—οΈ System Architecture

Kiriong is built using a Django Monolithic Architecture, where each major feature is isolated into a modular Django app for a clear separation of concerns. This approach streamlines development and deployment for the current scale.

Core Components

  • AI & Machine Learning: We use Google Gemini for its cost-effectiveness and quality in generating learning pathways, module content, and powering our AI chatbot. Service recommendations are driven by a content-based filtering system using TF-IDF and cosine similarity.
  • Data & Media: The application is designed for a PostgreSQL production database and integrates with Cloudinary for optimized media storage. WeasyPrint is used for generating PDF certificates on the fly.
  • Backend Services: Transactional emails (confirmations, verification, etc.) are reliably handled by Brevo (Sendinblue) through django-anymail.
  • Design Philosophy: We chose a PWA over a native app to ensure a single codebase provides a native-like experience across all devices without app store delays, which is ideal for the Nigerian market.

πŸ›  Tech Stack

  • Backend: Django 5.0.6, PostgreSQL, Gunicorn
  • Frontend: Bootstrap 5.3.3, Vanilla JS, CKEditor 5
  • AI & APIs: Google Gemini, YouTube Data API v3
  • Services: Brevo (email), Cloudinary (media), Google OAuth, reCAPTCHA
  • ML: Scikit-learn
  • PDF Generation: WeasyPrint

πŸš€ Local Development Setup

1. Clone & Install

git clone https://github.com/nwokike/kiriong.git
cd kiriong
pip install -r requirements.txt

2. Configure Environment Variables

Create a .env file in the root directory and add the necessary keys.

SECRET_KEY=your-django-secret-key
DEBUG=True
DATABASE_URL=postgresql://user:password@host:port/database

# AI & APIs
GEMINI_API_KEY=your-gemini-api-key
YOUTUBE_API_KEY=your-youtube-api-key

# Email
BREVO_API_KEY=your-brevo-api-key
DEFAULT_FROM_EMAIL=noreply@kiri.ng

# Media Storage
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

# Google OAuth (optional)
GOOGLE_OAUTH_CLIENT_ID=your-client-id
GOOGLE_OAUTH_CLIENT_SECRET=your-client-secret

# reCAPTCHA (optional)
RECAPTCHA_PUBLIC_KEY=your-site-key
RECAPTCHA_PRIVATE_KEY=your-secret-key

3. Setup Database & Static Files

python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput

4. Run the Server

python manage.py runserver 0.0.0.0:5000

Visit http://localhost:5000 in your browser.


πŸ—‚οΈ Complete Project Structure

kiriong/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml              # CI/CD pipeline for automated deployments
β”œβ”€β”€ academy/                        # App: AI-powered learning platform
β”‚   β”œβ”€β”€ migrations/                 # Database schema changes for the academy
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── academy/                # Templates specific to the academy
β”‚   β”‚       β”œβ”€β”€ academy_home.html
β”‚   β”‚       β”œβ”€β”€ certificate.html
β”‚   β”‚       β”œβ”€β”€ create_pathway.html
β”‚   β”‚       β”œβ”€β”€ dashboard.html
β”‚   β”‚       β”œβ”€β”€ pathway_detail.html
β”‚   β”‚       β”œβ”€β”€ pathway_list.html
β”‚   β”‚       └── public_pathway_detail.html
β”‚   β”œβ”€β”€ templatetags/               # Custom template filters and tags
β”‚   β”œβ”€β”€ admin.py                    # Django admin configuration for academy models
β”‚   β”œβ”€β”€ ai_services.py              # Handles all Google Gemini AI integrations
β”‚   β”œβ”€β”€ apps.py                     # App-specific configuration
β”‚   β”œβ”€β”€ forms.py                    # Forms for pathway creation, quizzes, etc.
β”‚   β”œβ”€β”€ models.py                   # Data models (LearningPathway, Module, Badge)
β”‚   β”œβ”€β”€ urls.py                     # URL routing for the academy
β”‚   └── views.py                    # Logic for handling requests and rendering pages
β”œβ”€β”€ blog/                           # App: Community blogging platform
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── blog/
β”‚   β”‚       β”œβ”€β”€ post_detail.html
β”‚   β”‚       β”œβ”€β”€ post_form.html
β”‚   β”‚       └── post_list.html
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ apps.py
β”‚   β”œβ”€β”€ forms.py                    # Contains the CKEditor 5 form integration
β”‚   β”œβ”€β”€ models.py                   # Data models (Post, Comment)
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ core/                           # App: Core functionality and shared components
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── core/
β”‚   β”‚       β”œβ”€β”€ base.html           # The master base template for the entire site
β”‚   β”‚       β”œβ”€β”€ privacy.html
β”‚   β”‚       └── terms.html
β”‚   β”œβ”€β”€ context_processors.py       # Provides global context (e.g., notification count)
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py                    # Handles homepage, AI chatbot logic, etc.
β”œβ”€β”€ kiriong/                        # Main Django project configuration
β”‚   β”œβ”€β”€ asgi.py                     # ASGI entrypoint for async servers
β”‚   β”œβ”€β”€ settings.py                 # Core project settings and configurations
β”‚   β”œβ”€β”€ urls.py                     # Root URL configuration for the project
β”‚   └── wsgi.py                     # WSGI entrypoint for traditional servers
β”œβ”€β”€ marketplace/                    # App: Artisan services and bookings
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── marketplace/
β”‚   β”‚       β”œβ”€β”€ artisan_dashboard.html
β”‚   β”‚       β”œβ”€β”€ booking_notification_email.html
β”‚   β”‚       β”œβ”€β”€ service_confirm_delete.html
β”‚   β”‚       β”œβ”€β”€ service_detail.html
β”‚   β”‚       β”œβ”€β”€ service_form.html
β”‚   β”‚       └── service_list.html
β”‚   β”œβ”€β”€ templatetags/
β”‚   β”œβ”€β”€ models.py                   # Data models (Category, Service, Booking)
β”‚   β”œβ”€β”€ recommender.py              # ML logic for service recommendations
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ media/                          # User-uploaded files (development)
β”œβ”€β”€ notifications/                  # App: In-app user notifications
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── notifications/
β”‚   β”‚       └── notification_list.html
β”‚   β”œβ”€β”€ models.py                   # Data model (Notification)
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ static/                         # Development static files (CSS, JS, images)
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css
β”‚   β”œβ”€β”€ images/
β”‚   β”‚   β”œβ”€β”€ icons/
β”‚   β”‚   β”œβ”€β”€ logo-dark.png
β”‚   β”‚   └── logo.png
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ dashboard.js
β”‚   β”‚   └── theme-toggle.js
β”‚   β”œβ”€β”€ manifest.json               # PWA manifest file
β”‚   └── service-worker.js           # PWA service worker for offline capabilities
β”œβ”€β”€ staticfiles/                    # Collected static files for production
β”œβ”€β”€ templates/                      # Global templates (not tied to a specific app)
β”‚   β”œβ”€β”€ account/                    # Templates for django-allauth
β”‚   β”œβ”€β”€ registration/               # Templates for Django's built-in auth
β”‚   └── email_base.html
β”œβ”€β”€ users/                          # App: User management, profiles, and authentication
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── users/
β”‚   β”‚       β”œβ”€β”€ certificates.html
β”‚   β”‚       β”œβ”€β”€ profile_detail.html
β”‚   β”‚       └── profile_edit.html
β”‚   β”œβ”€β”€ models.py                   # Custom Profile model, Certificate, SocialMediaLink
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ .gitignore                      # Specifies files and folders for Git to ignore
β”œβ”€β”€ README.md                       # This file
β”œβ”€β”€ build.sh                        # Script for production builds (collectstatic, migrations)
β”œβ”€β”€ manage.py                       # Django's command-line utility
└── requirements.txt                # List of all Python package dependencies

πŸ” Security Features

  • Built-in CSRF protection and secure password hashing.
  • Email verification for new user accounts.
  • Google reCAPTCHA v2 to prevent bot abuse.
  • Protection against XSS and SQL injection via Django's core features.
  • HTTPS is enforced in production environments.

About

A Django-powered platform empowering Nigerian artisans with a marketplace, an innovative AI-driven learning academy, community blogging, and real-time engagement tools.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors