Skip to content

hmaach/forum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forum Application

A comprehensive web forum application built using Go that enables user communication through posts, comments, and reactions.

Authors

  • Abdelhamid Bouziani
  • Hamza Maach
  • Omar Ait Benhammou
  • Mehdi Moulabbi
  • Youssef Basta

Features

User Authentication

  • Username-based registration and login
  • Secure session management using cookies

Content Management

  • Create and read posts
  • Comment on posts
  • Multiple category associations for posts

Interaction System

  • Like/dislike functionality for posts and comments
  • Comprehensive user engagement tools

Content Discovery

  • Filter posts by categories
  • Filter posts by creation date

Project Structure

forum/
├── cmd/
│   └── main.go           # Application entry point
├── server/
│   ├── config/           # Configuration management
│   ├── database/         # Database interaction logic
│   ├── controllers/      # Request handling and business logic
│   ├── models/           # Data structures and models
│   ├── validators/       # Request validation
│   ├── routes/           # Application routing
│   └── utils/            # Shared utility functions
├── web/ 
│   ├── assets/           # Static resources (CSS, JS, images)
│   └── templates/        # HTML templates
├── dockerfile            # Docker containerization
├── commands.sh           # Docker build and deployment script
├── go.mod                # Go module dependencies
├── go.sum                # Dependency checksum
└── README.md             # Project documentation

Database Schema

View the detailed database schema here.

Key Tables

  • Users: User authentication and profile information
  • Posts: Forum post content
  • Comments: Post responses and discussions
  • Categories: Post classification
  • Categories_Posts: Post-category relationships
  • Posts_Reactions: Post interaction tracking
  • Comments_Reactions: Comment interaction tracking
  • Sessions: User authentication state management

Technologies

Backend

  • Go 1.22+
  • SQLite3 database
  • bcrypt for password hashing

Frontend

  • HTML5 & CSS3
  • JavaScript
  • Font Awesome icons

Development & Deployment

  • Docker containerization

Getting Started

Prerequisites

  • Go 1.22 or higher
  • SQLite3
  • Docker (optional)

Local Development

  1. Clone the Repository

    git clone https://github.com/hmaach/forum.git
    cd forum
  2. Install Dependencies

    go mod download
  3. Database Management

    • Create database schema:

      go run . --migrate
    • Create schema with demo data:

      go run . --seed
    • Drop database schema:

      go run . --drop
  4. Run the Application

    cd cmd
    go run .

    Access the forum at http://localhost:8080

Docker Deployment

  1. Make script executable:

    chmod +x commands.sh
  2. Run deployment script:

    ./commands.sh
  3. Access the forum at http://localhost:8080

Contributing

Please read our contributing guidelines before submitting pull requests or issues.

About

A web forum platform built with Go, HTML, CSS, JavaScript and SQLite.

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Contributors