Hey there
After some problems and delays, I would like to publish #chatable source code
There has been lots of Sneak Peeks in this post, but probably everyone wants the .AIA to see how ti has been made
http://community.thunkable.com/t/chatable-project/3077?u=barreeeiroo
I’m not going to make a very long post, as I think everything about the system has been already published in the upper topic
Also, I would like to say that if there are no errors reported, in a week I will make a tutorial for how to integrate my system in your apps in a very simple way, using the examples of a support helpdesk or game chat rooms
Well, here is the .AIA:
- ChatAble_Public.aia (794.0 KB)
Compiled APK using my server:
- ChatAble.apk (3.57 MB)
The server files can be found here:
The database structure is here too:
-- phpMyAdmin SQL Dump
-- version 4.4.15.8
-- https://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generaciĂłn: 24-06-2017 a las 08:58:50
-- VersiĂłn del servidor: 5.5.50-MariaDB
-- VersiĂłn de PHP: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `ChatAble`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `alerts`
--
CREATE TABLE IF NOT EXISTS `alerts` (
`id` int(11) NOT NULL,
`title` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`content` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`button` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`theme` enum('light','dark') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'dark',
`image` varchar(10000) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `alerts`
--
INSERT INTO `alerts` (`id`, `title`, `content`, `button`, `theme`, `image`) VALUES
(1, 'Welcome', '<b>Thanks for using ChatAble</b><br>Hope you enjoy <i>;)</i>', 'Ok', 'light', 'https://s-media-cache-ak0.pinimg.com/originals/a9/69/a2/a969a2f2aa0cfebe48479abb318e5214.png');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `group_chats`
--
CREATE TABLE IF NOT EXISTS `group_chats` (
`id` int(50) NOT NULL,
`alias` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`creator` int(10) NOT NULL,
`users` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`timestamp` varchar(25) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `group_messages`
--
CREATE TABLE IF NOT EXISTS `group_messages` (
`id` int(255) NOT NULL,
`group_id` int(50) NOT NULL,
`sender_id` int(10) NOT NULL,
`content` longtext COLLATE utf8_unicode_ci NOT NULL,
`type` enum('text','image') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'text',
`timestamp` varchar(25) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `private_chats`
--
CREATE TABLE IF NOT EXISTS `private_chats` (
`id` int(100) NOT NULL,
`user_server` int(50) NOT NULL,
`user_client` int(50) NOT NULL,
`timestamp` int(20) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `private_messages`
--
CREATE TABLE IF NOT EXISTS `private_messages` (
`id` int(100) NOT NULL,
`chat_id` int(50) NOT NULL,
`sender_id` int(10) NOT NULL,
`content` longtext NOT NULL,
`type` enum('text','image','cleverbot') NOT NULL DEFAULT 'text',
`timestamp` varchar(25) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `reader`
--
CREATE TABLE IF NOT EXISTS `reader` (
`id` int(250) NOT NULL,
`user_id` int(10) NOT NULL,
`chat_id` int(50) NOT NULL,
`counter` int(5) NOT NULL,
`type` enum('private','group','support','unknown') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unknown'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `support_messages`
--
CREATE TABLE IF NOT EXISTS `support_messages` (
`id` int(10) NOT NULL,
`ticket_id` int(50) NOT NULL,
`content` longtext COLLATE utf8_unicode_ci NOT NULL,
`type` enum('title','text','image') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'text',
`admin_msg` enum('true','false') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'false',
`timestamp` varchar(30) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `support_tickets`
--
CREATE TABLE IF NOT EXISTS `support_tickets` (
`id` int(10) NOT NULL,
`user_id` int(10) NOT NULL,
`admin_id` int(10) NOT NULL DEFAULT '0',
`timestamp` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) NOT NULL,
`username` varchar(30) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`admin` enum('true','false') NOT NULL DEFAULT 'false',
`blocked` enum('true','false') NOT NULL DEFAULT 'false'
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `password`, `admin`, `blocked`) VALUES
(1, 'system', 'bot@chat.thunkable.ga', 'null', 'true', 'false');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `versions`
--
CREATE TABLE IF NOT EXISTS `versions` (
`id` int(10) NOT NULL,
`versionCode` int(25) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `versions`
--
INSERT INTO `versions` (`id`, `versionCode`) VALUES
(1, 1);
--
-- ĂŤndices para tablas volcadas
--
--
-- Indices de la tabla `alerts`
--
ALTER TABLE `alerts`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `group_chats`
--
ALTER TABLE `group_chats`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `group_messages`
--
ALTER TABLE `group_messages`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `private_chats`
--
ALTER TABLE `private_chats`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `private_messages`
--
ALTER TABLE `private_messages`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `reader`
--
ALTER TABLE `reader`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `support_messages`
--
ALTER TABLE `support_messages`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `support_tickets`
--
ALTER TABLE `support_tickets`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `versions`
--
ALTER TABLE `versions`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `alerts`
--
ALTER TABLE `alerts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `versions`
--
ALTER TABLE `versions`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Hope this helps to users trying to integrate chat systems in their apps
Regards,
Diego