Deployment Documentation - s566466div/GDP-Project-EduLearn-03 GitHub Wiki
EduLearn Application Deployment Documentation
Requirements for Deploying the Code
1. Server Environment
- A server that supports both Java (for Spring Boot) and Node.js, such as Render for hosting the EduLearn application.
2. Java Runtime Environment (JRE)
- Ensure the appropriate JRE version is installed for running the Spring Boot backend.
3. Node.js and npm
- Node.js and npm are required for managing frontend dependencies and running the frontend assets.
4. Database
- Set up a database server (e.g., MySQL or any SQL database service compatible with Spring Boot) to store persistent data if your application requires it.
5. Build Tools
- Use Maven for building the Spring Boot backend.
- If required, Webpack or similar tools can help build the frontend assets.
6. Networking
- Set up DNS and domain configurations if using a custom domain.
- Configure firewall rules to allow traffic on necessary ports (e.g., port 5050 for Spring Boot).
Here’s a streamlined version of your deployment instructions for the EduLearn application, with updated information on your backend, frontend, and database details:
Steps to Deploy the EduLearn Application on Render
Step 1: Set Up Render Account
- Go to Render.com and create an account.
- Connect Render to your GitHub repository (
GDP-Project-EduLearn-03
).
Step 2: Configure Web Service on Render for EduLearn Project
-
Create a New Web Service
- In your Render dashboard, click New > Web Service to start setting up your frontend and backend services.
-
Service Configuration
-
Frontend Service:
- Service Name: Set as
EduLearn-Frontend
. - Branch: Choose the branch to deploy from, typically
main
. - Environment: Select Node.
- Build Command: Use
npm install
. - Start Command: Use
npm start
. - URL: Frontend Once deployed, your frontend will be accessible at
https://gdp-project-edulearn-03.onrender.com
.
- Service Name: Set as
-
Backend Service:
- Service Name: Set as
EduLearn-Backend
. - Branch: Select
main
. - Environment: Choose Java and set it to your preferred Java version.
- Build Command: Use
./mvnw clean install
if using Maven. - Start Command: Use
java -jar target/<your-spring-boot-app-name>.jar
. - URL: Backend Your backend will be accessible at
https://edulearn-backend-el3y.onrender.com
.
- Service Name: Set as
-
Database Configuration:
- Database Name: Set as
Edu-learn
. - Hostname:
dpg-cshsemogph6c73ct0b1g-a
- Port: 5432
- Database Name:
edu_learn
- Username:
edu_learn_user
- Password:
yr3aCqf11qvKwZ5V2WLRJA7sLgoJqxZM
- External Database URL:
postgresql://edu_learn_user:yr3aCqf11qvKwZ5V2WLRJA7sLgoJqxZM@dpg-cshsemogph6c73ct0b1g-a.oregon-postgres.render.com/edu_learn
- Database Name: Set as
-
Step 3: Deploy the Application
- Click Create Web Service for both frontend and backend. Render will automatically build and deploy the services based on these configurations.
Step 4: Access the Application
- After deployment, Render will provide unique URLs for accessing your frontend and backend:
Additional Notes
-
Environment Variables:
- Set
REACT_APP_API_URL
in the frontend to point to your backend URL (https://edulearn-backend-el3y.onrender.com/api
). - Configure database-related variables such as
DB_HOST
,DB_NAME
,DB_USER
, andDB_PASSWORD
for the backend.
- Set
-
Database Access:
- Internal Database URL:
postgresql://edu_learn_user:yr3aCqf11qvKwZ5V2WLRJA7sLgoJqxZM@dpg-cshsemogph6c73ct0b1g-a/edu_learn
- External Database URL:
postgresql://edu_learn_user:yr3aCqf11qvKwZ5V2WLRJA7sLgoJqxZM@dpg-cshsemogph6c73ct0b1g-a.oregon-postgres.render.com/edu_learn
- Command to access the database via terminal:
PGPASSWORD=yr3aCqf11qvKwZ5V2WLRJA7sLgoJqxZM psql -h dpg-cshsemogph6c73ct0b1g-a.oregon-postgres.render.com -U edu_learn_user edu_learn
- Internal Database URL:
-
Automatic Updates:
- Any code pushed to the specified branch will trigger automatic redeployment, keeping your app current with new changes.