# Welcome to ThreadR Rewritten This is the source code for the ThreadR Forum Engine, rewritten in Go. ThreadR is a free and open-source forum engine designed to allow users to host their own forum instances on personal web servers. ## Project Overview Originally started as a school project in 2019 with the aim of creating a hybrid between a forum and a social media platform, ThreadR was temporarily abandoned after school ended. Revived in 2020, the project shifted focus to become a fully functional, portable, and open-source forum engine under the Apache 2.0 license. ### Current Goals - [ ] Bring ThreadR back online (see issue #2) - [ ] Go FOSS by making the source code publicly available (see issue #5) - [ ] Ensure portability for easy setup of personal instances - [ ] Implement core forum features (sign-up, board creation, threads, messages, profiles) ### Future Features - Anonymous posting with unique per-thread identifiers for registered users - Thread subscription and notifications for new messages (opt-out available) - "Split thread here" functionality for focused discussions - Automatic loading of new messages in threads (opt-out in settings) - Question threads with an "accept answer" feature - Nuanced like/dislike system (limited functionality, inspired by StackExchange) **Note:** ThreadR is now technically host-independent with configurable settings, though it remains a work in progress (WIP). ## Installation ThreadR is in early development, and setup is currently manual. Automated setup scripts will be added in the future. ### Prerequisites This guide assumes you are on a UNIX-like system with the following installed: - Apache with PHP (may work with other web servers) - MySQL or MariaDB - Python 3 - Bash ### Setup Steps 1. Clone this repository into a directory accessible by your web server but outside any web root. 2. Create a MySQL/MariaDB database with the tables listed below. 3. Add a dedicated MySQL/MariaDB user for ThreadR and grant usage privileges for the tables. 4. Symlink the `build/` directory to your desired web root location (ThreadR does not support direct web root linking). 5. Adjust configuration files in the `config/` directory to match your setup. 6. Run `./deployment-script.sh` to apply the configuration. 7. Optionally, symlink `build/redirect_home.html` to redirect specific locations to ThreadR. ### Database Schema - **boards** - `id` (int, primary key, auto increment) - `name` (varchar) - `user_friendly_name` (varchar) - `private` (boolean or tinyint(1)) - `public_visible` (boolean or tinyint(1)) - **posts** - `id` (int, primary key, auto increment) - `board_id` (int) - `user_id` (int) - `post_time` (timestamp, default current_timestamp()) - `edit_time` (timestamp, nullable, default null, on update current_timestamp()) - `content` (text, nullable, default null) - `attachment_hash` (bigint(20), nullable, default null) - `attachment_name` (varchar, nullable, default null) - `title` (varchar) - `reply_to` (int, default -1) - **profiles** (usage TBD) - `id` (smallint, primary key, index) - `email` (varchar, index, likely unique) - `display_name` (varchar) - `status` (varchar) - `about` (long varchar) - `website` (varchar) - **users** - `id` (smallint, primary key) - `name` (varchar, index, likely unique) - `authentication_string` (varchar(128)) - `authentication_salt` (varchar) - `authentication_algorithm` (varchar) - `time_created` (timestamp, default current_timestamp()) - `time_altered` (timestamp, default current_timestamp(), on update current_timestamp()) - `verified` (boolean or tinyint(1), default 0) ## Running the Application To start the ThreadR server, run the following command after configuration: ``` go run ./main.go ``` The server will start on port 8080 by default. ## Project Structure - **src/**: Core ThreadR source files - **build/**: Placeholder for deployment, contains a working instance after running the deployment script - **config/**: Configuration files for specific ThreadR instances - **macros/**: Files for use with the variable grabbler script - **static/**: Static assets (CSS, images) for the web interface - **templates/**: HTML templates for rendering pages - **handlers/**: HTTP request handlers for various routes - **models/**: Database models and interaction logic - **deployment_script.sh**: Script for code variable replacement and deployment tasks - **variable_grabbler.py**: Custom macro processor for configuration - **LICENSE.md**: Apache 2.0 license details - **NOTICE**: Copyright notice in plain text ## Contributing We welcome contributions! Please discuss ideas or issues in the GitHub issues section or join our Discord server for real-time communication: [discord.gg/r3w3zSkEUE](https://discord.gg/r3w3zSkEUE). ## License ThreadR is licensed under the Apache 2.0 License. See [LICENSE.md](./LICENSE.md) for details. **Authors:** BodgeMaster, Jocadbz