This repository contains the source code for the MDD (Meet, Discover, Discuss) full-stack application, featuring an Angular frontend and a Spring Boot backend.
Before you begin, ensure you have the following installed on your system:
- Java 17 or later
- Maven
- Node.js and npm (LTS version recommended)
- MySQL
The backend requires a MySQL database to function.
-
Create the Database: Open a MySQL client and run the following command to create the database:
CREATE DATABASE mdd_db;
-
Set Environment Variables: The application uses environment variables to connect to the database and for JWT security. You need to configure them before launching the server.
Create a file named
.envin theback/directory of the project and add the following variables, replacing the placeholder values with your actual MySQL credentials and a strong, unique secret for the JWT key.# /back/.env SPRING_DATASOURCE_USERNAME=your_mysql_username SPRING_DATASOURCE_PASSWORD=your_mysql_password JWT_SECRET_KEY=your_super_secret_and_long_jwt_key_hereNote: Ensure your shell is configured to load
.envfiles or export these variables manually before running the application.
Navigate to the back directory and run the application using the Maven wrapper:
cd back
mvn spring-boot:runThe server will start on http://localhost:8080.
On its first launch, the backend will automatically populate the mdd_db database with initial data, including:
- Several themes (Java, JavaScript, etc.).
- A default test user.
- A collection of sample articles associated with the test user and themes.
Test User Credentials:
- Email:
testuser@example.com - Username:
testuser - Password:
password
Once the backend is running, you can explore and test the API endpoints using the Swagger UI, which is available at:
http://localhost:8080/swagger-ui/index.html#/
Navigate to the front directory and install the required npm packages:
cd front
npm installRun the following command to start the Angular development server:
ng serveThe application will be available at http://localhost:4200/. The app will automatically reload if you make any changes to the source files.
To create a production build of the frontend, run:
ng buildThe build artifacts will be stored in the dist/ directory.