A Spring Boot application for managing research papers, using MySQL as the database.
git clone https://github.com/OmkarKashyap/Research-Paper-App.git
cd Research-Paper-AppSupabase provides a PostgreSQL database for your application automatically when you create a project. You don't need to run any manual SQL commands to create a database.
Here's how to get started with your Supabase database:
-
Create an Account on Supabase: If you don't have one already, go to https://supabase.com/ and create a free account.
-
Create a New Project:
- Once logged in, you'll see a dashboard. Click on the "New project" button.
- You'll be asked to provide a name for your project, choose a region for your database server (select one closest to your users for better latency), and set a database password (make sure to remember this password).
- Click "Create new project". Supabase will then provision a PostgreSQL database for your project. This might take a few moments.
-
Your Database is Ready: Once your project is created, your PostgreSQL database is automatically set up and ready to use.
-
Find Your Connection Details: To connect your Spring Boot application, you'll need the connection details:
- In your Supabase project dashboard, navigate to the "Database" section in the left-hand sidebar.
- Click on "Connection info".
- You'll find various connection strings and details, including the JDBC connection URL, username (usually
postgres), and the password you set when creating the project. You'll need these details for configuring your environment variables in the next step.
To connect your Spring Boot application to your Supabase database, you need to configure the database connection details as environment variables. Here are two options:
For Windows (PowerShell):
$env:SUPABASE_DATABASE_URL=<jdbc url>
$env:SUPABASE_DATABASE_USER="<user>"
$env:SUPABASE_DATABASE_PASSWORD="<password>"For macOS/Linux (Terminal):
export SUPABASE_DATABASE_URL="<jdbc url>"
export SUPABASE_DATABASE_USER="<user>"
export SUPABASE_DATABASE_PASSWORD="<password>"Create a .env file in the project root and add the following:
DATABASE_URL=jdbc:mysql://localhost:3306/research_paper_app
DATABASE_USER=root
DATABASE_PASSWORD=YOUR_MYSQL_PASSWORDStep 1: Build the Project
mvn clean installStep 2: Run the Application
mvn spring-boot:runBy default, the application runs on http://localhost:8082.
Spring Boot, Spring Data JPA, MySQL, PostgreSQL, Hibernate, Maven
| Method | Endpoint | Description |
|---|---|---|
| GET | /papers |
Get all research papers |
| POST | /papers |
Add a new research paper |
| GET | /papers/{id} |
Get a paper by ID |
| PUT | /papers/{id} |
Update a paper |
| DELETE | /papers/{id} |
Delete a paper |
This project is licensed under the MIT License – feel free to modify and use it!