JerseyHUB E-Commerce Backend Rest API is a feature-rich backend solution for E-commerce applications developed using Golang with the Gin web framework. This API is designed to efficiently handle routing and HTTP requests while following best practices in code architecture and dependency management.
- Clean Code Architecture: The project follows clean code architecture principles, making it maintainable and scalable.
- Dependency Injection: Utilizes the Dependency Injection design pattern for flexible component integration.
- Compile-Time Dependency Injection: Dependencies are managed using Wire for compile-time injection.
- Database: Leverages PostgreSQL for efficient and relational data storage.
- AWS Integration: Integrates with AWS S3 for cloud-based storage solutions.
- E-Commerce Features: Implements a wide range of features commonly found in e-commerce applications, including cart management, wishlist, wallet, offers, and coupon management.
- Code Quality: Includes unit tests to maintain code quality and implements Continuous Integration/Continuous Deployment (CI/CD) with GitHub Actions.
The application is hosted on AWS EC2 and is served using Nginx, ensuring reliability and scalability.
- Containerization: The project is containerized using Docker, and successful deployment and scaling are tested on Kubernetes.
For interactive API documentation, Swagger is implemented. You can explore and test the API endpoints in real-time.
Security is a top priority for the project:
- OTP Verification: Twilio API is integrated for OTP verification.
- Payment Integration: Razorpay API is used for payment processing.
- Refresh Tokens: Enhances security and extends user sessions using refresh tokens.
In collaboration with a team of developers, a mobile application is being built using the Flutter framework to complement this backend API.
To run the project locally, you can follow these steps:
- Clone the repository.
- Set up your environment with the required dependencies, including Golang, PostgreSQL, Docker, and Wire.
- Configure your environment variables (e.g., database credentials, AWS keys, Twilio credentials).
- Build and run the project.
This project is licensed under the [LICENSE_NAME] license - see the LICENSE.md file for details.
- Gin Web Framework
- Wire for Dependency Injection
- PostgreSQL
- AWS S3
- Swagger API Documentation
- Twilio
- Razorpay
- Flutter Framework
To use go-gin-clean-arch
project, follow these steps:
# Navigate into the project
cd ./go-gin-clean-arch
# Install dependencies
make deps
# Generate wire_gen.go for dependency injection
# Please make sure you exported the env for GOPATH
make wire
# Run the project in Development Mode
make run
Additional commands:
➔ make help
build Compile the code, build Executable File
run Start application
test Run tests
test-coverage Run tests and generate coverage file
deps Install dependencies
deps-cleancache Clear cache in Go module
wire Generate wire_gen.go
swag Generate swagger docs
mock Generate Mock Files using mockgen
help Display this help screen
Before running the project, you need to set the following environment variables with your corresponding values:
DB_HOST
: Database hostDB_NAME
: Database nameDB_USER
: Database userDB_PORT
: Database portDB_PASSWORD
: Database password
DB_AUTHTOKEN
: Twilio authentication tokenDB_ACCOUNTSID
: Twilio account SIDDB_SERVICESID
: Twilio services ID
AWS_REGION
: AWS regionAWS_ACCESS_KEY_ID
: AWS access key IDAWS_SECRET_ACCESS_KEY
: AWS secret access key
Make sure to provide the appropriate values for these environment variables to configure the project correctly.