Skip to content

chutongren/nowcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

If you want to run this forum website locally, please follow these steps.

Prerequisites

Make sure the following software is installed on your machine:

  • JDK 23.0.2
  • Apache Maven 3.9.9
  • Spring Boot 3.4.3
  • Spring Security 6.4.3
  • MyBatis 3.0.4
  • Redis 7.2.7
  • Kafka 3.9.0
  • Elasticsearch 7.17.1
  • MySQL 9.2.0
  • Kaptcha 2.3.2
  • Spring Email 3.4.3
  • Quartz, Caffeine, Spring Boot Actuator

You can check the exact versions used in this project by looking at the pom.xml file.


Setup

1️⃣ Database

Run the following SQL commands to initialize the database. You can find the SQL files in the init_sql directory:

create database community;
use community;
source [filelocation]/init_schema.sql;
show tables;
source [filelocation]/init_data.sql;

Replace [filelocation] with the actual path to your SQL files.


2️⃣ Configuration

Update application.properties and related files to match your environment:

  • Set your MySQL username and password
  • Set the port you want to use
  • Set the email and password for the email account used to send activation emails

There are three property files:

  • application.properties
  • application-develop.properties
  • application-produce.properties

In application.properties, choose the active profile:

spring.profiles.active=develop   # for local development
spring.profiles.active=produce   # for production deployment

If you are deploying the project, update global.js:

var CONTEXT_PATH = "";  // instead of: var CONTEXT_PATH = "/community";

3️⃣ Start Required Services

Start the following services in separate terminals:

brew services start redis

zookeeper-server-start /opt/homebrew/etc/zookeeper/zoo.cfg

kafka-server-start /opt/homebrew/etc/kafka/server.properties

./bin/elasticsearch  # Run this from your Elasticsearch directory

4️⃣ Run the Project

Finally, start the application:

Run `CommunityApplication.java`

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors