Skip to content

Ans1110/flower-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flower Sharing

A full-stack social media application for sharing flowers and connecting with others.

🌐 Live Deployment

🛠️ Tech Stack

Frontend

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • State Management: Zustand
  • Data Fetching: TanStack Query (React Query)
  • Forms: React Hook Form + Zod
  • UI Components: shadcn/ui, Radix UI

Backend

  • Language: Go 1.24.5
  • Framework: Gin
  • Database: MySQL (via GORM)
  • Authentication: JWT + OAuth2
  • File Storage: Cloudinary
  • Documentation: Swagger
  • Logging: Zap

📁 Project Structure

flower-sharing/
├── frontend/          # Next.js frontend application
│   ├── src/
│   │   ├── app/      # Next.js app router pages
│   │   ├── components/  # React components
│   │   ├── hooks/    # Custom React hooks
│   │   ├── lib/      # Utility libraries
│   │   ├── service/  # API service layer
│   │   ├── store/    # Zustand stores
│   │   └── types/    # TypeScript type definitions
│   └── package.json
│
└── backend/          # Go backend API
    ├── controllers/  # HTTP handlers
    ├── services/    # Business logic
    ├── repositories/ # Data access layer
    ├── models/      # Database models
    ├── middlewares/ # HTTP middlewares
    ├── routes/      # API routes
    ├── dto/         # Data transfer objects
    └── go.mod

🚀 Getting Started

Prerequisites

  • Node.js 20+ (for frontend)
  • Go 1.24.5+ (for backend)
  • MySQL database
  • Cloudinary account (for image uploads)

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
bun install
# or
npm install
  1. Create a .env.local file with your environment variables:
NEXT_PUBLIC_API_URL=http://localhost:8080
# Add other environment variables as needed
  1. Run the development server:
bun dev
# or
npm run dev
  1. Open http://localhost:3000 in your browser.

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
go mod download
  1. Create a .env file with your environment variables:
DB_HOST=localhost
DB_PORT=3306
DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=flower_sharing
JWT_SECRET=your_jwt_secret
CLOUDINARY_URL=your_cloudinary_url
# Add other environment variables as needed
  1. Run the server:
go run main.go
  1. API will be available at http://localhost:8080
  2. Swagger documentation at http://localhost:8080/swagger/index.html

📝 Features

  • User authentication (JWT + OAuth2)
  • User profiles and following system
  • Post creation and management
  • Image uploads via Cloudinary
  • Admin panel for user and post management
  • Responsive design with dark mode support

🔧 Development

Frontend Scripts

  • bun dev - Start development server
  • bun build - Build for production
  • bun start - Start production server
  • bun lint - Run ESLint

Backend

  • go run main.go - Run development server
  • go build - Build binary
  • swag init - Generate Swagger documentation

Releases

No releases published

Packages

 
 
 

Contributors

Languages