This repository contains the source code for a basic e-commerce platform built using Golang for the backend, Angular for the frontend, and PostgreSQL for the database. The platform allows users to browse products, add items to their cart, and complete the checkout process. It also includes user accounts, order history, and payment integration features.
Before you begin, ensure you have the following installed on your local machine:
- Go (version 1.16 or later)
- Node.js (version 14.x or later)
- Angular CLI (version 12.x or later)
- PostgreSQL
- Clone the repository:
git clone https://github.com/yourusername/ecommerce-platform.git
- Change to the
backend
directory:
cd ecommerce-platform/backend
- Download the required Go dependencies:
go mod download
- Update the
main.go
file with your PostgreSQL credentials:
go db, err := gorm.Open("postgres", "host=localhost dbname=ecommerce sslmode=disable user=youruser password=yourpassword")"
Replace youruser and yourpassword with your PostgreSQL username and password.
- Change to the frontend directory:
cd ecommerce-platform/frontend
- Install the required npm packages:
npm install
- Change to the backend directory:
cd ecommerce-platform/backend
- Run the backend server:
go run main.go
The backend server will start on http://localhost:8080.
- Change to the frontend directory:
cd ecommerce-platform/frontend
- Run the frontend development server:
ng serve
The frontend server will start on http://localhost:4200.
Please note that this e-commerce platform is intended for educational and demonstration purposes only. The platform has not been thoroughly tested, and some security features may not be implemented. For production use, consider making the necessary changes and improvements to ensure the application is secure and efficient.
Make sure to replace yourusername
with your actual GitHub username or any other namespace that you prefer.
This project is licensed under the MIT License.