Welcome to the Backend API for College Bazar. This repository powers the backend services, handling authentication, database interactions, and business logic.
- 🔐 Authentication & Authorization (JWT)
- 🗄️ Database Management (MongoDB)
- ⚡ High Performance & Scalable
- 📡 RESTful APIs
- 🛡️ Security Best Practices
- 🏗️ Docker & CI/CD Ready
📦 college-bazar-backend
├── 📁 assets/ # Static assets like images
├── 📁 controllers/ # Contains all the controllers
├── 📁 middlewares/ # Contains Middleware Code
├── 📁 models/ # Code for the global models (mongo collections)
├── 📁 routes/ # All the routes are defined in this
└── 📄 Dockerfile/ # Docker file to run the application
Ensure you have the following installed:
- Golang (v1.23)
- MongoDb
- Docker
Clone the repository and install dependencies:
git clone https://github.com/ayush3160/college-bazar-backend.git
cd college-bazar-backend
go mod download
Copy the environment variables present in .env.local file and create a new .env file.
PORT=8000
MONGO_URI=mongodb://localhost:27017/college-bazar
MONGO_DB_NAME=college-bazar
JWT_SECRET=some-random-jwt-secret-key
For Development
go run main.go --debug --development
For Production
go run main.go
docker compose up --build