Fashionista Backend is a RESTful API server built using Go. It supports user authentication, store and inventory management, and integration with Google Cloud Storage (GCS).
- User Authentication:
- Support for user registration and login using JWT.
- Use FireBase to verify via OTP
- Store Management:
- Create and manage stores and their inventory.
- Inventory Management:
- Add, list, and delete items from the inventory.
- Try-one:
- Integration with Google Cloud Storage for image upload and management.
- Seamless integration with other , such as the TryOn API.
- CI/CD:
- GoLint
- CD
Fashionista/
├── app/
│ ├── main.go # Entry point of the application
│ ├── routes.go # Route definitions for public and protected APIs
├── config/
│ ├── config.go # Centralized configuration
│ ├── db_config.go # Database configuration
│ ├── gsc_config.go # Google Cloud Storage (GCS) config
│ ├── jwt_config.go # JWT-related configuration
│ ├── load_env.go # Environment variable loader
│ ├── model_config.go # Model-related config
│ ├── server_config.go # Server setup configuration
├── controllers/ # API controllers
├── docker/
│ ├── postgresql/
│ │ ├── init_db.sql # Initial SQL setup for PostgreSQL
│ ├── docker-compose.yml
│ ├── init.sh # Script for initializing the application with Docker
├── middlewares/
│ ├── auth.go # Middleware for authentication
├── models/
│ ├── dto.go # Data Transfer Objects
│ ├── service_account.go # GCS service account model
│ ├── setup.go # Database and model initialization
├── run/
│ ├── start.sh # Script to start the project
├── services/
│ ├── auth_service/
│ │ ├── auth.go # User authentication service
│ ├── external/
│ │ ├── external.go # External service integration
│ │ ├── gcp.go # Google Cloud Platform utility functions
│ │ ├── page_service.go
│ │ ├── try_on_api.go
│ ├── user_service/
│ ├── user.go # User-related business logic
├── templates/
│ ├── add_item.html # Frontend template for adding items
│ ├── create_store.html
│ ├── home.html
├── utils/
│ ├── response.go # Standardized API responses
│ ├── token.go # JWT utilities
│ ├── valid.go # Validation functions
├── .env # Environment variables
├── go.mod # Go module file
├── LICENSE # License information
├── file config Firebase and GCS
└── README.md # Project documentation
- Go: Installed on your system (Installation Guide).
- Docker: Required for database setup.
- Google Cloud: A configured service account with storage permissions.
git clone <repository-url>
cd Fashionista
File .env và smart-exchange connect to Kante
bash start_server.sh
You can test the API endpoints using tools like Postman or cURL. Make sure the backend is running locally or deployed to an accessible server.
- Use Conventional Commits to ensure clear and consistent commit messages:
feat
: Adding new features (e.g.,feat: add user authentication endpoint
).fix
: Fixing bugs (e.g.,fix: resolve token expiration issue
).docs
: Updating documentation (e.g.,docs: update README with API examples
).refactor
: Refactoring code without adding features or fixing bugs (e.g.,refactor: optimize database queries
).test
: Adding or updating tests (e.g.,test: add unit tests for user service
).
- Avoid vague commit messages like "update code" or "fix bug."
- Pre-Merge Checks:
- PRs must pass all CI checks, including linting, testing, and build validation.
- Development Environment Deployment:
- Merging into the
dev
branch triggers automatic deployment to the development environment via GitHub Actions.
- Merging into the
- Production Environment Deployment:
- Changes merged into the
main
branch are automatically deployed to production after passing all tests.
- Changes merged into the
- Use GitHub Actions with workflows for:
- Running linting checks (e.g.,
golangci-lint
). - Running unit and integration tests.
- Building and deploying Docker containers.
- Running linting checks (e.g.,
This process ensures high-quality code, smooth collaboration, and reliable deployments.
This project is licensed under the MIT License.