This repository contains a web application for uploading images, consisting of a frontend built with React and Vite, and a backend implemented in Golang.
- Image Upload: Securely upload images.
- Backend API: Golang-based API for image handling and storage.
- React: JavaScript library for building user interfaces.
- Vite: Next-generation frontend tooling for React applications.
- Tailwind CSS: Utility-first CSS framework for styling.
- Axios: Promise-based HTTP client for making requests to the backend API.
- Golang: Programming language for building scalable backend services.
- Gorilla Mux: Powerful HTTP router and dispatcher for Golang web servers.
- GORM: ORM library for Golang, used for database interactions.
- PostgreSQL: Relational database for storing image metadata.
- frontend/: Contains the React frontend code.
- backend/: Contains the Golang backend code.
To run the application locally, follow these steps:
- Node.js (with npm or yarn)
- Golang
- PostgreSQL
-
Clone the repository:
git clone https://github.com/sajin-shrestha/imageUpload.git cd imageUpload
-
Navigate to backend folder:
cd backend
-
Create a .env file in root folder with following data:
DB_HOST=localhost DB_USER=<database-username> DB_PASSWORD=<database-password> DB_NAME=<database-name> DB_PORT=5432
-
Install Dependencies:
go mod tidy
-
Start the backend server:
go run main.go
-
Navigate to the frontend/ directory and set up the React environment
cd frontend
-
Install dependencies:
npm install
-
Start the frontend development server:
npm run dev
-
Access the Application
Open your browser and visit http://localhost:3000 to access the application.
Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please follow the existing code style and conventions.