Before you begin, ensure you have the following installed:
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/Abdev1205/21BCE11045_Backend.git
-
Build and start the application:
Use Docker Compose to build and start the application along with its dependencies.
docker-compose up --build
This command will:
- Build the Docker images for the Go application, PostgreSQL, and Redis and then project will start
-
Verify the setup:
Once the containers are up, you can verify that the application is running by accessing the server's endpoint. By default, it should be available at
http://localhost:8080
.
/server
: Contains the entry point for the server.main.go
: Starts and configures the server.
/internal
: non-exportable packages./adapters
: Infrastructure layer (database, file handling, caching)./database
: PostgreSQL database./cache
: Redis caching.
/application
: Application layer./file_service
: File service logic (Upload, Retrieve, etc.)./auth_service
: JWT authentication logic (Login, Register, etc.).
/pkg
: Shared utilities./middleware
: Middleware for JWT authentication and other purposes./config
: Configuration management (DB, Redis, JWT, etc.).
docker-compose.yml
andDockerfile
: Configuration for Docker Compose and Docker build.go.mod
: Go module dependencies.