0% found this document useful (0 votes)
112 views

Farming Assistance System: A Project Report On

The document provides steps to configure a Spring Boot backend and Angular frontend for a farming assistance system project. Key steps include: 1. Configuring the Java environment and creating a Spring Boot project with packages, models, repositories, services and controllers. 2. Generating Angular components, services and routing configuration. 3. Connecting the frontend to the backend by implementing services with backend URLs.

Uploaded by

sai teja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Farming Assistance System: A Project Report On

The document provides steps to configure a Spring Boot backend and Angular frontend for a farming assistance system project. Key steps include: 1. Configuring the Java environment and creating a Spring Boot project with packages, models, repositories, services and controllers. 2. Generating Angular components, services and routing configuration. 3. Connecting the frontend to the backend by implementing services with backend URLs.

Uploaded by

sai teja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

A PROJECT REPORT ON

FARMING ASSISTANCE SYSTEM

Team Members:
Shivam Singh
Abhinav Singh
Sahil Singhla
Himanshu Rai
Vinoothna
Devashish Singh
Back – End Documentation

For configuring java path in environment variables:


Step 1: In Search, search for and then select: System (Control Panel)

Step 2: Click the Advanced system settings link.

Step 3: Click Environment Variables. In the section System Variables, find


the PATH environment variable and select it. Click Edit. If the PATH environment variable
does not exist, click New.

Step 4: In the Edit System Variable (or New System Variable) window, specify the


value of the PATH environment variable. Click OK. Close all remaining windows by
clicking OK.
Step 5: Reopen Command prompt window, and run your java code.

Following are the steps to create Spring Boot Project:

Step 1: Open the Spring initializer https://start.spring.io.

Step 2: Provide the Group and Artifact name. We have provided Group


name com.capgemini.medical and Artifact medical.

Step 3: Now click on the Generate button.

When we click on the Generate button, it starts packing the project in a .zip file and
downloads the project.

Step 4: Extract the ZIP file.

Step 5: Import the folder.

File -> Import -> Existing Maven Project -> Next -> Browse -> Select the project -> Finish
It takes some time to import the project. When the project imports successfully, we can see
the project directory in the Package Explorer. The following image shows the project
directory:

Step 6: Create packages:

 Controller

 bean

 Repository

 Model

 security

 exception

Step 7: Create model classes inside model package:

 AdvertisementDAO.java
 MspDAO.java
 StockDAO.java
 ComplainDAO.java

Create Interfaces inside repository package which extends JPA repository:

 AdvertisementServiceImpl.java
 MspServiceImpl.java
 StockServiceImpl.java
 ComplainServiceImpl.java

Create Controller classes inside controller package:

 Controller-
This controller includes:
addAdvertisement()-To post the advertisement
viewStocks()- To view all the stocks
updateComplaint()- To update complain
deleteAdvertisement()- To delete stocks advertisement
deleteMsp()- To delete Msp

 UserController
This controller includes:
userRegister()-To register[authority,farmer,supplier,retailer]
viewStock()- To view the product
addStock()- To add the stock
addAdvertisement()-To add advertisement
deleteAdvertisement()-To delete advertisement
viewComplaint()-To view the complain
updateComplain()-To update complain etc likewise many methods.

Step 9: Inside src/main/resources in application.properties files put your database details:

spring.datasource.url = jdbc:mysql://localhost:3306/medical_db?
allowPublicKeyRetrieval=true&useSSL=false
spring.datasource.username = root
spring.datasource.password = root
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto = update

Step 10: Inside pom.xml file include all these following dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.javassist/javassist -->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
</dependencies>

Step 11: Run the personality-prediction-Application.java file.

Right-click on the file -> Run As -> Java Applications


Front-End Documentation

Following are the steps to create Angular Project:

Step 1: Go to the site https://nodejs.org/en/download/ and download the necessary binary


files.

Step 2: Double click on the downloaded .msi file to start the installation. Click the Run
button on the first screen to begin the installation.

Step 3: In the next screen, click the "Next" button to continue with the installation

Step 4: In the next screen, Accept the license agreement and click on the Next button.

Step 5: In the next screen, choose the location where Node.js needs to be installed and then
click on the Next button.

1. First, enter the file location for the installation of Node.js. This is where the files for
Node.js will be stored after the installation.

2. Click on the Next button to proceed ahead with the installation.

Step 6: Accept the default components and click on the Next button.

Step 7: In the next screen, click the Install button to start the installation

Step 8: Click the Finish button to complete the installation.

Step 9: Install the Angular CLI by following command:

npm install -g @angular/cli

Step 10: Create a workspace and initial application:

ng new farming assistance system


Step 11: Run the application

The Angular CLI includes a server, so that you can build and serve your app locally.
1. Navigate to the workspace folder, such as my-app.
2. Run the following command:
-cd fas

-ng serve –open

Step 12: Now generate components by following commands:

 ng generate component addStock: To add product


 ng generate component viewStock: To view the product
 ng generate component updateComplain: To update product
 ng generate component deleteStock: To delete product
 ng generate component addAdvertisement: To post advertisement
 ng generate component viewMsp: To see the Msp
 ng generate component addMsp: To add cost of goods
 ng generate component alterMsp: For user to edit Msp

Step 13: Now in routing.module.ts put this array for further navigation in the project :

const routes: Routes = [


import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AddAdvertisementComponent } from './add-advertisement/add-
advertisement.component';
import { AddMspComponent } from './add-msp/add-msp.component';
import { HomeComponent } from './home/home.component';
import { LoginComponent } from './login/login.component';
import { MyAdvertisementsComponent } from './my-advertisements/my-
advertisements.component';
import { RegisterComponent } from './register/register.component';
import { SelectRoleToRegisterComponent } from './select-role-to-
register/select-role-to-register.component';
import { UpdateDeleteMspComponent } from './update-delete-msp/update-delete-
msp.component';
import { ViewAdvertisementComponent } from './view-advertisement/view-
advertisement.component';
import { ViewMspComponent } from './view-msp/view-msp.component';
import { UpdateComplaintComponent } from './complaint/update-complaint/update-
complaint.component';
import { ViewComplaintComponent } from './complaint/view-complaint/view-
complaint.component';
import { AddStockComponent } from './stock/add-stock/add-stock.component';
import { StockDetailComponent } from './stock/stock-detail/stock-
detail.component';
import { ViewStockComponent } from './stock/view-stock/view-stock.component';

const routes: Routes = [
  { path: '', redirectTo: '/login', pathMatch: 'full' },
  {path : 'login', component : LoginComponent},
  {path : 'home', component : HomeComponent},
  {path : 'addAd', component : AddAdvertisementComponent},
  {path : 'myAds', component : MyAdvertisementsComponent},
  {path : 'viewAd', component : ViewAdvertisementComponent},
  {path : 'register', component : RegisterComponent},
  {path : 'selectRole', component : SelectRoleToRegisterComponent},
  {path : 'addMsp', component : AddMspComponent},
  {path : 'viewMsp', component : ViewMspComponent},
  {path : 'updateDeleteMsp', component : UpdateDeleteMspComponent},
  { path: 'complaints', component:ViewComplaintComponent },
  { path: 'updateComplaint', component:UpdateComplaintComponent },
  { path: 'addStock', component: AddStockComponent },
  { path: 'stocks', component: ViewStockComponent },
  { path: 'stockDetail', component: StockDetailComponent }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

Step 14: Now generate services by the following commands :


 ng generate service login: Includes all the methods along with backend url.
 ng generate service profile: Includes all the methods along with backend url.
 ng generate service user: Includes all the methods along with backend url.
Step 15: Now run the application by: ng serve

You might also like