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.
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
- Language: Go (version 1.18+)
- HTTP Framework: Fiber v2 (High-performance Express-like routing)
- Database: MongoDB (utilizing the official
mongo-driverpackage) - File Uploads: AWS S3 Client SDK v2
- Authentication: JSON Web Tokens (
golang-jwt/jwt) & bcrypt password cryptography
Ensure you have the following installed on your machine:
- Go Lang (1.18+)
- MongoDB Community Server (running locally or a remote MongoDB Atlas URL string)
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-bucketDownload all defined package dependencies and start the fiber router server:
# Fetch defined packages
go mod tidy
# Start application server
go run main.goThe server will boot up and bind to standard port 5000:
🟢 Fiber router server successfully started on port :5000
POST /api/auth/register- Create new administrator credentialsPOST /api/auth/login- Authenticate admin & receive JWT access tokenGET /api/auth/me- Fetch profile metadata for logged-in user
GET /api/products- List all catalog itemsPOST /api/products- Create new product detailsPUT /api/products/:id- Update product details & inventory stock levelsDELETE /api/products/:id- Delete product from catalog
GET /api/orders- List store transactional ordersPOST /api/orders- Create new order invoiceGET /api/orders/:id- Fetch detailed order invoice and line itemsPUT /api/orders/:id- Update shipping & payment status
GET /api/banners- Fetch active promotional schedulesPOST /api/banners- Schedule new site bannerPUT /api/banners/:id- Update banner details or toggle active statusDELETE /api/banners/:id- Remove promotional bannerGET /api/landing-pages- List all JSON landing pagesPOST /api/landing-pages- Save new landing page design configuration
GET /api/blog- List all advice articlesPOST /api/blog- Publish new fashion tips articlePUT /api/blog/:id- Update article detailsDELETE /api/blog/:id- Remove blog article
- Divakaran S (divakaran.sivasamy@gmail.com)