Giter VIP home page Giter VIP logo

zengzhik / fastanswer Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 2.05 MB

快答社区:一个简约的编程问题交流社区,现有提问、回复、通知等功能……技术栈主要为:SpringBoot+MyBatis-Plus+BootStrap。仿照码问社区开发,对其后端代码和前端样式进行了改进,有在线演示地址,欢迎大家测试!

Java 100.00%
spring-boot oauth-app mysql cos

fastanswer's Introduction

FastAnswe—快答社区

本项目GitHub地址:https://github.com/ZengZhiK/fastanswer

在线演示地址

部署在腾讯云服务器上:http://81.70.197.22:8080/ (由于XSS攻击,目前无法访问)

希望各位小伙伴能在我的论坛系统上多多发言,帮助我测试一下系统,谢谢各位!

具体使用:

  • GitHub登录 -> 提问 (Markdown语法、支持图片上传) -> 可在首页看到提问的问题
  • GitHub登录 -> 点击任意问题 -> 可以发表回复
  • GitHub登录 -> 点击头像 -> 可以查看自己发表的问题和别人的最新回复 (也可以点击小铃铛)

本地运行手册

1、git clone https://github.com/ZengZhiK/fastanswer.git把本项目的代码拉取下来,之后右键IntelliJ IDEA 启动,等待maven自动加载包

2、使用MySQL数据库客户端软件(例如SQLyog、Navicat)执行脚本sql/fastanswer.sql创建fastanswer数据库

3、重命名src/main/resources/目录下的application-backup.ymlapplication.yml,其中**为需要填写的参数

4、填写响应application.yml参数

  • MySQL数据库用户名和密码

  • 注册GItHub OAuth Apps

    • 在Github主页找到Setting=>Developer settings=>OAuth Apps=>New OAuth App填写
    • 将Client ID和Client secrets拷贝到application.yml对应处
  • 注册腾讯云账号,找到对象储存COS(新用户可以免费使用半年),创建储存桶

    • 在密钥管理找到SecretId和SecretKey拷贝到application.yml对应处

5、至此配置完毕,点击com.zzk.fastanswer.FastanswerApplication启动,在浏览器地址栏输入http://localhost:8080/访问

技术栈

技术 链接
后端 Spring Boot https://spring.io/
MyBatis-Plus https://baomidou.com/
MySql https://www.mysql.com/
GitHub OAuth https://docs.github.com/en/free-pro-team@latest/developers/apps/building-oauth-apps
Hutool https://www.hutool.cn/
fastjson https://github.com/alibaba/fastjson
Lombok https://www.projectlombok.org/
hibernate-validator http://hibernate.org/validator/documentation/
腾讯云COS https://cloud.tencent.com/document/product/436
前端 Bootstrap https://v3.bootcss.com/
editor.md https://github.com/pandao/editor.md
jquery-validation https://github.com/jquery-validation/jquery-validation
jquery.form http://malsup.com/jquery/form/
jQuery.scrollTo https://github.com/flesler/jquery.scrollTo
jQuery-Tags-Input https://github.com/xoxco/jQuery-Tags-Input
jquery-loading https://github.com/CarlosBonetti/jquery-loading

后端技术栈:

  • 后端MyBatis-Plus操作数据库,包括代码生成器(代码在src/test/java/com/zzk/fastanswer/mybatisplus/CodeGenerator.java),个人感觉比MyBatis更简单好用。
  • 社区设计仅支持GitHub登录,使用了OAuth协议,并使用hutool发起Http请求,hutool是一个Java工具包,其功能非常强大,其作者在B站也做过讲解【Hutool】2020年全网独一份作者亲授使用教程!github上Star10.9K的开源项目工具!
  • 其他的包:fastjson用于操作json、Lombok用于简化Java Bean的开发、hibernate-validator用于参数校验,采用的是JSR 303: Bean Validation规范、腾讯云COS用于搭建图床,上传图片

前端技术栈:

  • Bootstrap搭建页面(前端比较菜,写不出好看的页面,只是在老师的基础上简单修改了一下)
  • editor.mdMarkdown编辑器js插件,比富文本编辑器强太多了
  • jquery-validation表单校验、jquery.form异步提交表单、jQuery.scrollTo页面滚动插件、 jQuery-Tags-Input标签插件、 jquery-loading在页面显示加载状态

页面展示

  • 首页
  • 问题详情页
  • 提问页

提问支持Markdown语法、支持图片上传(腾讯云COS)

  • 我的问题页
  • 最新回复页

最新回复的个数是通过拦截器实现的,登录后每次请求都会先查询一下未读消息数,效率比较低......

点击未读徽章可以标记该回复为已读

  • Error页

redis分布式session

  • pom.xml引入
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.session</groupId>
    <artifactId>spring-session-data-redis</artifactId>
</dependency>
  • 开启redis分布式session
@Configuration
@EnableRedisHttpSession(redisNamespace = "redis:session")
public class RedisSessionConfig {
}

fastanswer's People

Contributors

zengzhik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.