- Java 21 (as specified in pom.xml)
- Maven (or use the included Maven wrapper)
Navigate to the project directory:
cd Backend/brainbridge/brainbridge.\mvnw.cmd spring-boot:run./mvnw spring-boot:runcd Backend/brainbridge/brainbridge
mvn spring-boot:runFirst, build the project:
cd Backend/brainbridge/brainbridge
.\mvnw.cmd clean packageThen run the JAR:
java -jar target/brainbridge-0.0.1-SNAPSHOT.jar-
IntelliJ IDEA:
- Open the project:
File→Open→ SelectBackend/brainbridge/brainbridge - Right-click on
BrainbridgeApplication.java - Select
Run 'BrainbridgeApplication.main()'
- Open the project:
-
Eclipse:
- Import as Maven project
- Right-click on
BrainbridgeApplication.java - Select
Run As→Java Application
-
VS Code:
- Install Java Extension Pack
- Open the project folder
- Press
F5or clickRun→Start Debugging
Once started, you should see output like:
Started BrainbridgeApplication in X.XXX seconds
The application will be available at:
- API Base URL: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
- OpenAPI JSON: http://localhost:8080/v3/api-docs
- H2 Database Console: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:brainbridgedb - Username:
sa - Password: (leave empty)
- JDBC URL:
- Open http://localhost:8080/swagger-ui.html in your browser
- You'll see all available endpoints organized by tags (Users, Projects, Comments, Analytics)
- Click on any endpoint to expand and see details
- Click "Try it out" to test the endpoint
- Fill in the required parameters and click "Execute"
Register a new user:
curl -X POST http://localhost:8080/api/users/register \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"username": "testuser",
"password": "password123",
"confirmPassword": "password123",
"firstName": "Test",
"lastName": "User"
}'Login:
curl -X POST http://localhost:8080/api/users/login \
-H "Content-Type: application/json" \
-d '{
"emailOrUsername": "test@example.com",
"password": "password123"
}'Get all users:
curl http://localhost:8080/api/usersIf port 8080 is already in use, you can change it in application.properties:
server.port=8081Make sure you have Java 21 installed:
java -versionIf you have a different version, either:
- Install Java 21
- Or change the Java version in
pom.xml(line 30) to match your installed version
Try:
.\mvnw.cmd clean installThe application uses H2 in-memory database by default. All data will be lost when you stop the application.
To persist data, you can configure MySQL in application.properties (currently commented out in pom.xml).