Skip to content

Commit 27a9234

Browse files
authored
Add files via upload
1 parent d7fce85 commit 27a9234

12 files changed

+474
-0
lines changed

.classpath

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
15+
<attributes>
16+
<attribute name="maven.pomderived" value="true"/>
17+
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
21+
<attributes>
22+
<attribute name="optional" value="true"/>
23+
<attribute name="maven.pomderived" value="true"/>
24+
<attribute name="test" value="true"/>
25+
</attributes>
26+
</classpathentry>
27+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
28+
<attributes>
29+
<attribute name="maven.pomderived" value="true"/>
30+
</attributes>
31+
</classpathentry>
32+
<classpathentry kind="output" path="target/classes"/>
33+
</classpath>

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
/build/
3+
.classpath
4+
.settings

.project

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>onlinebookstore</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.m2e.core.maven2Builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
31+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
32+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
33+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
34+
<nature>org.eclipse.jdt.core.javanature</nature>
35+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
36+
</natures>
37+
<filteredResources>
38+
<filter>
39+
<id>1665573956898</id>
40+
<name></name>
41+
<type>30</type>
42+
<matcher>
43+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
44+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
45+
</matcher>
46+
</filter>
47+
</filteredResources>
48+
</projectDescription>

CODE_OF_CONDUCT.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [Contact Email Address](https://flowcv.me/shashirajraja). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Contributing
2+
3+
[pr]: https://github.com/raise-dev/hacktoberfest/compare
4+
[style]: https://github.com/bbatsov/ruby-style-guide
5+
6+
Hi there! We're thrilled that you'd like to contribute to Hacktoberfest. Your help is essential for keeping it great.
7+
8+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
9+
10+
## Opening an issue
11+
12+
Thank you for taking the time to open an issue, your feedback helps make Hacktoberfest better.
13+
Before opening an issue, please be sure that your issue hasn't already been asked by using [GitHub search](https://help.github.com/articles/searching-issues/)
14+
15+
Here are a few things that will help us help resolve your issues:
16+
17+
- A descriptive title that gives an idea of what your issue refers to
18+
- A thorough description of the issue, (one word descriptions are very hard to understand)
19+
- Screenshots (if appropriate)
20+
- Links (if appropriate)
21+
22+
## Submitting a pull request
23+
24+
0. Clone the repository
25+
0. Configure and install the dependencies: (See the [README](README.md) for more details)
26+
0. Make sure the tests pass on your machine: `script/test`
27+
0. Create a new branch: `git checkout -b my-branch-name`
28+
0. Make your change, add tests, and make sure the tests still pass
29+
0. Push to your branch and [submit a pull request][pr]
30+
0. Wait for your pull request to be reviewed and merged!
31+
32+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
33+
34+
- Follow the [style guide][style].
35+
- Write tests.
36+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
37+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
38+
39+
## Resources
40+
41+
- [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)
42+
- [Using Pull Requests](https://help.github.com/articles/using-pull-requests/)
43+
- [GitHub Help](https://help.github.com)

Dummy_Database.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
### Copy and Paste the following MYSQL commands to make a dummy database for this Project :
2+
3+
4+
create database if not exists onlinebookstore;
5+
6+
use onlinebookstore;
7+
8+
create table if not exists books(barcode varchar(100) primary key, name varchar(100), author varchar(100), price int, quantity int);
9+
10+
create table if not exists users(username varchar(100) primary key,password varchar(100), firstname varchar(100),lastname varchar(100),address text, phone varchar(100),mailid varchar(100),usertype int);
11+
12+
13+
insert into books values('9780134190563','The Go Programming Language','Alan A. A. Donovan and Brian W. Kernighan',400,8);
14+
15+
insert into books values('9780133053036','C++ Primer','Stanley Lippman and Josée Lajoie and Barbara Moo',976,13);
16+
17+
insert into books values('9781718500457','The Rust Programming Language','Steve Klabnik and Carol Nichols',560,12);
18+
19+
insert into books values('9781491910740','Head First Java','Kathy Sierra and Bert Bates and Trisha Gee',754,23);
20+
21+
insert into books values('9781492056300','Fluent Python','Luciano Ramalho',1014,5);
22+
23+
insert into books values('9781720043997','The Road to Learn React','Robin Wieruch',239,18);
24+
25+
insert into books values('9780132350884','Clean Code: A Handbook of Agile Software Craftsmanship','Robert C Martin',288,3);
26+
27+
insert into books values('9780132181273','Domain-Driven Design','Eric Evans',560,28);
28+
29+
insert into books values('9781951204006','A Programmers Guide to Computer Science','William Springer',188,4);
30+
31+
insert into books values('9780316204552','The Soul of a New Machine','Tracy Kidder',293,30);
32+
33+
insert into books values('9780132778046','Effective Java','Joshua Bloch',368,21);
34+
35+
insert into books values('9781484255995','Practical Rust Projects','Shing Lyu',257,15);
36+
37+
insert into users values('demo','demo','Demo','User','Demo Home','42502216225','[email protected]',2);
38+
39+
insert into users values('Admin','Admin','Mr.','Admin','Haldia WB','9584552224521','[email protected]',1);
40+
41+
insert into users values('shashi','shashi','Shashi','Raj','Bihar','1236547089','[email protected]',2);
42+
43+
commit;

Jenkinsfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage("git_checkout") {
5+
steps {
6+
echo "cloning repository"
7+
echo "repo cloned successfully"
8+
}
9+
}
10+
}
11+
}

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war

README.md

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# <a href="https://youtu.be/mLFPodZO8Iw" target="_blank"> OnlineBookStore </a>
2+
- A Java Web Developement Project
3+
- **Youtube VIDEO** for step by step Local Setup Guide : https://youtu.be/mLFPodZO8Iw
4+
<!--Check out the Live website demo: [https://theonlinebookstore.herokuapp.com](https://theonlinebookstore.herokuapp.com)-->
5+
- User Login Credentials: (shashi/shashi)
6+
- Admin Login Credentials: (Admin/Admin)
7+
8+
<hr>
9+
### About
10+
A user-friendly Online Bookstore project in which users can log in or register, view the available books, select books along with their quantity, and buy them. Users can also get payment receipts after successful payment. The project can also be used by the administrator, who can add new books, remove books, increase and decrease the quantity of books, change the price of the books as well as maintain the selling history of books.
11+
12+
![onlinebookstore](https://user-images.githubusercontent.com/34605595/137615096-8447d32d-bddc-4f13-a8ed-3c0f4dd5e04e.png)
13+
14+
<span style="color:blue">**This Website is built for following purpose:-**</span>
15+
- For Selling books online.
16+
- Maintaining books selling history.
17+
- Adding and managing books.
18+
- User Friendly.
19+
- For Implementation of Http Servlets in Java.
20+
- This is a Mini-project developed using Java, Jdbc, And Servlets.
21+
22+
<span style="color:blue">**Admin Have Following Access for this online store site:-**</span>
23+
- Add New Books.
24+
- View Books Available.
25+
- Remove Books.
26+
- Increase Books Amount.
27+
28+
<span style="color:blue">**Users Have Following Access for this online store site:-**</span>
29+
- Create New Account or Register.
30+
- Login.
31+
- View Available Books.
32+
- Select Books to Buy.
33+
- Select Books Quantity.
34+
- Buy Books.
35+
- Get Payment Receipt.
36+
37+
### Technologies used:-
38+
1. Front-End Development:
39+
- Html 5.
40+
- CSS.
41+
- Javascript.
42+
43+
2. Back-End Development:
44+
- Java [JDK 8+]
45+
- JDBC
46+
- Servlet
47+
48+
3. Database:
49+
- MySql
50+
51+
### ================ Software And Tools Required ================
52+
- Eclipse [Enterprise Edition]
53+
- Java [JDK 8+]
54+
- Tomcat v8.0+
55+
- Apache Maven
56+
- MySQL
57+
58+
### ================= Dummy Database Initialization =================
59+
60+
STEP 1: Open MySQL Command Prompt or MySQL Workbench
61+
62+
STEP 2: Login to the administrator user as : ```mysql -u <username> -p``` (Enter Password if asked)
63+
64+
STEP 3: Copy paste the following MySql Commands-
65+
```MySQL
66+
create database if not exists onlinebookstore;
67+
68+
use onlinebookstore;
69+
70+
create table if not exists books(barcode varchar(100) primary key, name varchar(100), author varchar(100), price int, quantity int);
71+
72+
create table if not exists users(username varchar(100) primary key,password varchar(100), firstname varchar(100),
73+
lastname varchar(100),address text, phone varchar(100),mailid varchar(100),usertype int);
74+
75+
insert into books values('9780134190563','The Go Programming Language','Alan A. A. Donovan and Brian W. Kernighan',400,8);
76+
insert into books values('9780133053036','C++ Primer','Stanley Lippman and Josée Lajoie and Barbara Moo',976,13);
77+
insert into books values('9781718500457','The Rust Programming Language','Steve Klabnik and Carol Nichols',560,12);
78+
insert into books values('9781491910740','Head First Java','Kathy Sierra and Bert Bates and Trisha Gee',754,23);
79+
insert into books values('9781492056300','Fluent Python','Luciano Ramalho',1014,5);
80+
insert into books values('9781720043997','The Road to Learn React','Robin Wieruch',239,18);
81+
insert into books values('9780132350884','Clean Code: A Handbook of Agile Software Craftsmanship','Robert C Martin',288,3);
82+
insert into books values('9780132181273','Domain-Driven Design','Eric Evans',560,28);
83+
insert into books values('9781951204006','A Programmers Guide to Computer Science','William Springer',188,4);
84+
insert into books values('9780316204552','The Soul of a New Machine','Tracy Kidder',293,30);
85+
insert into books values('9780132778046','Effective Java','Joshua Bloch',368,21);
86+
insert into books values('9781484255995','Practical Rust Projects','Shing Lyu',257,15);
87+
insert into users values('demo','demo','Demo','User','Demo Home','42502216225','[email protected]',2);
88+
insert into users values('Admin','Admin','Mr.','Admin','Haldia WB','9584552224521','[email protected]',1);
89+
insert into users values('shashi','shashi','Shashi','Raj','Bihar','1236547089','[email protected]',2);
90+
91+
commit;
92+
93+
```
94+
95+
### ========== Importing and Running The Project Through Eclipse EE ==========
96+
97+
Step 0: Open Eclipse Enterprise Edition. [Install, if not already installed.]
98+
99+
Step 1: Click On File > Import > Git > Projects From Git > Clone Uri > Paste The Repository Url as: ```https://github.com/shashirajraja/onlinebookstore.git```> Select master Branch > Next > Next > Finish.
100+
101+
Step 2. a: Go inside ```src/main/resources > application.properties``` and update the value of database details as per your usage, like db.driver, db.host, db.username and db.password according to your installed mysql/postgresql admin user credentials.
102+
103+
Step 2.b: Right Click on Project > Run as > Maven Build > In the goals field enter "clean install" > apply > run
104+
105+
Step 2.c: Right Click On Project > Build Path > Configure Build Path > Libraries > Remove and Update Any Libraries if Red Mark Exists > Finish.
106+
107+
Step 3: [Only If Tomcat Server is not configured in Eclipse] : Right Click On Project > Run As > Run On Server > Select Tomcat V8.0 > (Select Tomcat V8.0 Installation Location If Asked) Next > Add onlinebookstore > Finish.
108+
109+
Step 4: In The Server Tab > Double Click On Tomcat Server > Ports > Change The Port Number For Http/1.1 To 8083 > Close And Save.
110+
111+
Step 5: Right Click On Project > Run As > Run On Server > Select Tomcat v8.0 > Next > Add All> Done.
112+
113+
Step 6: Check Running The Site At <a href="http://localhost:8083/onlinebookstore/">http://localhost:8083/onlinebookstore/</a>
114+
115+
Step 7: Default Username And Password For Admin Is "Admin" And "Admin"
116+
117+
Step 8: The default Username And Password For User Is "shashi" And "shashi"
118+
119+
## FAQ
120+
**Question:1** Unable to Connect to Database?
121+
122+
**Answer:** Please check you have installed the mysql correctly and have updated the correct db details in application.properties file. Also you can try doing maven clean install and force update the project and restart.
123+
<hr>
124+
125+
Note:- Considering this as a Sample Project, we have not much considered of web security.
126+
#### Some Screenshots for the project:
127+
<img width="941" alt="image" src="https://user-images.githubusercontent.com/34605595/224769637-37c34d4b-26e7-4d49-b990-4c09b260ec31.png">
128+
<img width="954" alt="image" src="https://user-images.githubusercontent.com/34605595/224769990-f440f74d-41b2-4629-ba1c-a87267f225d9.png">
129+
<img width="930" alt="image" src="https://user-images.githubusercontent.com/34605595/224770145-5902054f-5943-44ac-b02f-92097c8a6972.png">
130+
<img width="934" alt="image" src="https://user-images.githubusercontent.com/34605595/224770257-e18a3810-0457-4b78-bf46-cf82746708ee.png">
131+
<img width="946" alt="image" src="https://user-images.githubusercontent.com/34605595/224770392-5a5478d2-98cc-44ee-8689-132b6b16af80.png">
132+
133+
134+
#### "Suggestions and project improvement ideas are welcomed!"
135+
136+
<bold>Thanks a lot,</bold><br/>
137+
Project Leader<br/>
138+
<b>Shashi Raj</b>

appspec.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 0.0
2+
os: linux
3+
files:
4+
- source: /output/books.war
5+
destination: /opt/tomcat8/webapps
6+
hooks:
7+
BeforeInstall:
8+
- location: scripts/start_server.sh
9+
timeout: 300
10+
runas: root
11+
ApplicationStop:
12+
- location: scripts/stop_server.sh
13+
timeout: 300
14+
runas: root

0 commit comments

Comments
 (0)