Please use your own database and ChatGPT API in the application.properties file (backend).
Kiddit is a social networking website designed for children to help them learn about different cultures, develop good internet etiquette, and reduce online hate speech. This project is developed using Angular (frontend) and Spring Boot (backend).
The backend of this project was generated using Spring Initializr. You can learn more or generate your own Spring Boot project at Spring Initializr.
- Java 17 (Backend Language)
- Angular CLI 19.1.6 (Frontend Framework)
- Spring (Backend Framework)
- Node.js (Latest Version Recommended, need npm for package management)
- Maven (Latest Version Recommended, for package management)
- Spring Web (RESTful APIs)
- Spring Data JPA (Database Access)
- Spring Security (JWT Authentication)
- Lombok (Reducing Boilerplate Code)
- MySQL Server (Database Management)
git clone https://github.com/qianxusheng/Kiddit.git
cd kidditThe Kiddit folder contains all backend-related files.
Inside this folder, the Web folder is the Angular frontend project.
All other files outside the Web folder are related to the backend.
The src folder inside the backend contains backend source code.
The pom.xml file in the backend folder manages backend dependencies.
The package.json file in the Web folder manages front dependencies.
Download and install Node.js (latest recommended version) from Node.js Official Website npm comes bundled with Node.js.
cd kiddit/web
npm installRefer to the Angular Official Documentation for more details.
Download and install Apache Maven (latest recommended version) from Maven Official Website.
cd kiddit
mvn installcd kiddit/web
ng servecd kiddit
mvn spring-boot:runThis project uses MySQL as the database. Please use MySQL Workbench 8.0 to connect to the database and view data.
The backend uses a MySQL database, and the connection settings are specified in the application.properties file:
spring.application.name=Kiddit
spring.datasource.url=**********************
spring.datasource.username=**********************
spring.datasource.password=**********************
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.MySQL8DialectEnsure that your MySQL server is running and properly configured to accept connections.
Use Postman for API Testing. Postman is a popular API testing tool. You can download and install it from Postman Official Website.
User Registration
POST http://localhost:8080/api/register
Content-Type: application/json
{
"username": "testuser",
"password": "password123",
"email": "[email protected]"
}User Login
POST http://localhost:8080/api/login
Content-Type: application/json
{
"username": "testuser",
"password": "password123"
}Get User List
GET http://localhost:8080/api/usersTo ensure consistency and maintainability in data transmission between the frontend and backend, all backend APIs must adhere to the following standard response format. This format includes three main fields: status, message, and data.
- status: The status code of the request processing, using HTTP status codes or custom status codes. Common status codes include:
- 200: Request was successful.
- 400: Bad request or invalid input.
- 500: Internal server error.
- message: The response message, providing a brief description of the status or error, to be processed or displayed to the user on the frontend.
- data: The data portion of the response, containing the actual data returned by the API. If the request is successful, data will contain the relevant information; if the request fails, data can be null.
When a request is successful, the response format should be as follows:
{
"status": 200,
"message": "Request was successful",
"data": {
"id": 1,
"username": "testuser",
"email": "[email protected]"
}
}If you want to contribute to Kiddit, please fork this project and submit a Pull Request.
This project follows the MIT license. Please refer to the LICENSE file for details. <<<<<<< HEAD
main =======
main/main