8000
Skip to content

redaezziani/sky-s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

119 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Sky S - Modern E-commerce Platform

Sky S - Modern E-commerce Platform

NestJS Next.js TypeScript Prisma PostgreSQL Docker TailwindCSS JWT

A modern, scalable e-commerce platform built with cutting-edge technologies and following industry best practices. Sky S combines a robust NestJS backend with a sleek Next.js frontend to deliver an exceptional shopping experience.

✨ Features

  • πŸ›’ Complete E-commerce Solution - Product catalog, shopping cart, order management
  • πŸ” Secure Authentication - JWT-based authentication with role-based access control
  • πŸ’³ Payment Integration - Secure payment processing
  • πŸ“± Responsive Design - Mobile-first approach with Tailwind CSS
  • 🎨 Modern UI - Beautiful components with shadcn/ui
  • πŸš€ High Performance - Optimized for speed and scalability
  • πŸ” Advanced Search - Smart product search and filtering
  • πŸ“Š Admin Dashboard - Comprehensive admin panel for store management

πŸ—οΈ Architecture

Sky S follows a microservices-inspired architecture with clear separation of concerns:

Backend (NestJS)

  • SOLID Principles - Clean, maintainable, and testable code
  • Modular Design - Feature-based modules for scalability
  • Type Safety - Full TypeScript implementation
  • API Documentation - Auto-generated Swagger documentation
  • Database - PostgreSQL with Prisma ORM
  • Authentication - JWT tokens with refresh token rotation
  • Validation - Input validation and sanitization
  • Error Handling - Centralized error handling and logging

Frontend (Next.js)

  • Server-Side Rendering - SEO-optimized pages
  • State Management - Zustand for efficient state handling
  • Component Library - shadcn/ui for consistent design
  • Styling - Tailwind CSS for utility-first styling
  • Type Safety - Full TypeScript integration
  • Performance - Code splitting and optimization

πŸ› οΈ Tech Stack

Backend

  • Framework: NestJS
  • Language: TypeScript
  • Database: PostgreSQL
  • ORM: Prisma
  • Authentication: JWT
  • Containerization: Docker
  • Validation: class-validator
  • Documentation: Swagger/OpenAPI

Frontend

  • Framework: Next.js 14
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui
  • State Management: Zustand
  • Forms: React Hook Form
  • HTTP Client: Axios/Fetch

DevOps & Tools

  • Containerization: Docker & Docker Compose
  • Database: PostgreSQL
  • Code Quality: ESLint, Prettier
  • Package Manager: npm/yarn
  • Version Control: Git

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/redaezziani/sky-s.git
    cd sky-s
  2. Backend Setup

    cd backend
    npm install
    
    # Copy environment variables
    cp .env.example .env
    
    # Start database with Docker
    docker-compose up -d postgres
    
    # Run Prisma migrations
    npx prisma migrate dev
    npx prisma generate
    
    # Seed the database (optional)
    npx prisma db seed
    
    # Start the backend server
    npm run start:dev
  3. Frontend Setup

    cd ../frontend
    npm install
    
    # Copy environment variables
    cp .env.example .env.local
    
    # Start the frontend server
    npm run dev
  4. Access the application

🐳 Docker Deployment

Run the entire application with Docker Compose:

# Build and start all services
docker-compose up --build

# Run in detached mode
docker-compose up -d

πŸ“ Project Structure

sky-s/
β”œβ”€β”€ backend/                 # NestJS Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication module
β”‚   β”‚   β”œβ”€β”€ users/          # User management
β”‚   β”‚   β”œβ”€β”€ products/       # Product catalog
β”‚   β”‚   β”œβ”€β”€ orders/         # Order management
β”‚   β”‚   β”œβ”€β”€ payments/       # Payment processing
β”‚   β”‚   └── common/         # Shared utilities
β”‚   β”œβ”€β”€ prisma/             # Database schema & migrations
β”‚   └── docker/             # Docker configurations
β”œβ”€β”€ frontend/               # Next.js Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/           # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”œβ”€β”€ lib/          # Utilities & configurations
β”‚   β”‚   β”œβ”€β”€ hooks/        # Custom React hooks
β”‚   β”‚   └── store/        # Zustand stores
└── docker-compose.yml     # Docker services

πŸ”§ Environment Variables

Backend (.env)

DATABASE_URL="postgresql://username:password@localhost:5432/skystore"
JWT_SECRET="your-super-secure-jwt-secret"
JWT_EXPIRES_IN="15m"
REFRESH_TOKEN_SECRET="your-refresh-token-secret"
REFRESH_TOKEN_EXPIRES_IN="7d"
PORT=3001

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=y
89D1
our-stripe-key

πŸ§ͺ Testing

Backend Tests

cd backend

# Unit tests
npm run test

# E2E tests
npm run test:e2e

# Test coverage
npm run test:cov

Frontend Tests

cd frontend

# Run tests
npm run test

# Run tests in watch mode
npm run test:watch

πŸ“Š API Documentation

The API documentation is automatically generated using Swagger and available at:

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • NestJS - A progressive Node.js framework
  • Next.js - The React framework for production
  • Prisma - Next-generation ORM
  • shadcn/ui - Beautifully designed components
  • Tailwind CSS - A utility-first CSS framework

πŸ“ž Support

For support, email support@sky-s.com or join our Slack channel.


Made with ❀️ by the Sky S Team

About

A modern, scalable e-commerce platform built with cutting-edge technologies and following industry best practices. Sky S combines a robust NestJS backend with a sleek Next.js frontend to deliver an exceptional shopping experience.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

0