Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧸 KiddoStyle Premium CMS Backend API

A high-performance backend API service built using Go (Golang), the Fiber web framework, and MongoDB. This service powers the administrative control panel for the KiddoStyle retail brand, handling catalog management, order processing, analytics aggregation, review moderation, return validations, S3 file uploads, and promotional landing page design configurations.


📁 Repository Directory Structure

kiddostyle-backend/
├── config/
│   └── db.go                   # MongoDB Connection & Client Manager
├── controllers/
│   ├── analytics_controller.go # Sales metrics & growth breakdowns
│   ├── auth_controller.go      # Administrator credentials, login & JWT tokens
│   ├── banner_controller.go     # Promotional banner asset schedule handlers
│   ├── blog_controller.go       # Fashion advice blog publication handlers
│   ├── brand_controller.go      # Brand registry catalog handlers
│   ├── category_controller.go   # Parent/child category trees
│   ├── coupon_controller.go     # Discounts, validity & code builders
│   ├── customer_controller.go   # CRM registry, notes & analytics
│   ├── health_controller.go     # System heartbeat diagnostics
│   ├── landing_page_controller.go # JSON layout templates for marketing campaigns
│   ├── order_controller.go      # Orders transactional calculations
│   ├── product_controller.go    # Catalog items CRUD & inventory levels
│   ├── return_controller.go     # Returns log approvals & refunds
│   ├── review_controller.go     # Customer rating feeds & admin replies
│   ├── role_controller.go       # Staff RBAC permissions matrix
│   ├── settings_controller.go   # Global store metadata details
│   └── upload_controller.go     # S3 bucket multi-part file uploader
├── middleware/
│   └── auth.go                 # Fiber JWT token extraction & verification filter
├── models/
│   ├── banner.go                # BSON/JSON schemas for Banners
│   ├── blog.go                  # BSON/JSON schemas for Blog Articles
│   ├── brand.go                 # BSON/JSON schemas for Brands
│   ├── category.go              # BSON/JSON schemas for Categories
│   ├── coupon.go                # BSON/JSON schemas for Coupons
│   ├── customer.go              # BSON/JSON schemas for Customers
│   ├── landing_page.go          # BSON/JSON schemas for Landing Pages
│   ├── order.go                 # BSON/JSON schemas for Orders
│   ├── product.go               # BSON/JSON schemas for Products
│   ├── return.go                # BSON/JSON schemas for Returns & Refunds
│   ├── review.go                # BSON/JSON schemas for Reviews
│   ├── role.go                  # BSON/JSON schemas for Staff Roles
│   ├── settings.go              # BSON/JSON schemas for Store Settings
│   └── user.go                  # BSON/JSON schemas for Administrators
├── routes/
│   └── routes.go                # Path Router mapping with CORS configurations
├── utils/
│   ├── auth.go                  # Password Hashing & JWT validation utils
│   └── s3.go                    # AWS S3 Client SDK upload configurations
├── .env.example                 # Template for local environment variables
├── .gitignore                   # Exclusions for bin files and secrets
├── go.mod                       # Dependencies list manager
├── go.sum                       # Package lock dependencies checksums
├── main.go                      # Application Entry Point
└── README.md                    # This Documentation File

🛠️ Technology Stack & Dependencies

  • Language: Go (version 1.18+)
  • HTTP Framework: Fiber v2 (High-performance Express-like routing)
  • Database: MongoDB (utilizing the official mongo-driver package)
  • File Uploads: AWS S3 Client SDK v2
  • Authentication: JSON Web Tokens (golang-jwt/jwt) & bcrypt password cryptography

⚙️ Setup & Installation Instructions

1. Prerequisites

Ensure you have the following installed on your machine:

2. Configure Environment Variables

Create a file named .env in the root of the backend folder and copy these properties inside:

PORT=5000
MONGO_URI=mongodb://localhost:27017
DB_NAME=kiddostyle

JWT_SECRET=supersecretjwtauthenticationkeyforadminroles

AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
AWS_REGION=us-east-1
S3_BUCKET_NAME=kiddostyle-assets-bucket

3. Run the Backend API Service

Download all defined package dependencies and start the fiber router server:

# Fetch defined packages
go mod tidy

# Start application server
go run main.go

The server will boot up and bind to standard port 5000: 🟢 Fiber router server successfully started on port :5000


📡 API Endpoint Reference

🔐 Authentication & Staff

  • POST /api/auth/register - Create new administrator credentials
  • POST /api/auth/login - Authenticate admin & receive JWT access token
  • GET /api/auth/me - Fetch profile metadata for logged-in user

📦 Product & Inventory Catalog

  • GET /api/products - List all catalog items
  • POST /api/products - Create new product details
  • PUT /api/products/:id - Update product details & inventory stock levels
  • DELETE /api/products/:id - Delete product from catalog

📊 Orders & Transactions

  • GET /api/orders - List store transactional orders
  • POST /api/orders - Create new order invoice
  • GET /api/orders/:id - Fetch detailed order invoice and line items
  • PUT /api/orders/:id - Update shipping & payment status

🏷️ Marketing & Promotions

  • GET /api/banners - Fetch active promotional schedules
  • POST /api/banners - Schedule new site banner
  • PUT /api/banners/:id - Update banner details or toggle active status
  • DELETE /api/banners/:id - Remove promotional banner
  • GET /api/landing-pages - List all JSON landing pages
  • POST /api/landing-pages - Save new landing page design configuration

📝 Blog & Content

  • GET /api/blog - List all advice articles
  • POST /api/blog - Publish new fashion tips article
  • PUT /api/blog/:id - Update article details
  • DELETE /api/blog/:id - Remove blog article

👨‍💻 Lead Developer

About

: Go Fiber and MongoDB backend API service powering the KiddoStyle premium catalog and content management system.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages