Discover Packages
github.com/emre-guler/question-answer
command
module
Version:
v0.0.0-...-5dedbe6
Opens a new window with list of versions in this module.
Published: Jan 1, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Question Answer Web Application
A web application built with Go that provides a platform for questions and answers. This project uses the Gin web framework and implements session-based authentication.
Project Structure
.
├── controllers/ # Request handlers and business logic
├── globals/ # Global variables and configurations
├── middleware/ # Custom middleware functions
├── models/ # Data models and database schemas
├── routes/ # Route definitions and grouping
├── service/ # Business service layer
├── templates/ # HTML templates (.gohtml files)
├── main.go # Application entry point
├── go.mod # Go module dependencies
└── go.sum # Go module checksum file
Technologies Used
Go - Programming language
Gin - Web framework
Gin Sessions - Session management
HTML Templates - Server-side rendering
Prerequisites
Go 1.16 or higher
Environment variables:
PORT: The port number for the server to listen on
Getting Started
Clone the repository:
git clone https://github.com/emre-guler/question-answer.git
Install dependencies:
go mod download
Set up environment variables:
export PORT=8080
Run the application:
go run main.go
The application will start on localhost:PORT.
Features
Public and private routes
Session-based authentication
Static file serving
HTML template rendering
Middleware support
Project Structure Details
controllers/: Contains the request handlers that process incoming HTTP requests
globals/: Stores global variables and configuration settings
middleware/: Custom middleware including authentication checks
models/: Data structures and database models
routes/: Route definitions split into public and private groups
service/: Business logic layer
templates/: GoHTML templates for rendering views
Contributing
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add some amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
controllers
service
Click to show internal directories.
Click to hide internal directories.