Unverified Commit e6a7914f authored by Khalid Ali's avatar Khalid Ali Committed by GitHub
Browse files

Feature/2-Add-README (#10)

* Add README.md

* Add a CONTRIBUTING.md file

* Add reviewer instructions

* Add LICENSE.md
parent 6bfcb8ba
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. The Travis-CI checks **WILL FAIL**. Do not be alarmed, this is normal due to environment variables
being secret. A reviewer will do the following steps once your PR is made:
1. External collaborator creates PR.
2. Internal reviewer reviews code for any security vulnerabilities (such as revealing env vars)
3. Internal reviewer creates a OHDSI repo branch to merge external PR into.
4. Internal reviewer modifes external PR to point to the new OHDSI repo branch to be the head.
5. PR is accepted and closed
6. New PR is created from internal OHSI branch. Travis will execute on the internal branch against our 3 dbs.
7. Once travis build completes with no errors on internal branch, it can be merged into master.
## Code of Conduct
### Our Pledge
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.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
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.
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.
### Scope
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.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and 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.
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.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
\ No newline at end of file
The MIT License
Copyright (c) 2018-2019 SRCT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Bookshare Backend
This repository is the backend portion of a project called Bookshare. The main project is to create a website where college students can buy and sell books to each other in a Craigslist-like fashion. This project was originally implemented in Python, but it has been neglected for some time. Hence, the reimplementation.
This project is aimed specifically for students of George Mason University, but the code can be reformatted for other schools. The frontend portion of this project is being developed [here](https://git.gmu.edu/kali21/bookshare-frontend).
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
Highly, highly recommend using Intellij Idea as the IDE. This project runs on Java 8. It also depends on another project that implements a CAS Server for authentication located [here](https://git.gmu.edu/kali21/cas-server).
### Installing
Once you have Java 8 installed, go ahead and clone the project.
```
$ git clone https://github.com/khalludi/bookshare-backend.git
```
For project to work, you also need to clone the CAS Server project. The CAS server require Java 11 to run.
```
$ git clone https://git.gmu.edu/kali21/cas-server
```
For the CAS server, you need to have a certificate and a keystore. Use the following commands to create the keystore and certificate.
```
$ keytool -genkey -keyalg RSA -alias tomcat -keystore tomcat.keystore -storepass changeit -validity 360 -keysize 2048
$ keytool -export -alias tomcat -file thekeystore.crt
-keystore tomcat.keystore
```
Now, you need to include the certificate file in your JDK's `cacerts` file. Make sure to change the last part of the command to the path of your JDK.
```
$ keytool -import -alias tomcat -storepass changeit -file thekeystore.crt
-keystore "C:\Program Files\Java\jdk1.8.0_152\jre\lib\security\cacerts"
```
Last thing before running is to change `cas-user/src/main/resources/etc/cas/config/cas.properties` to reflect your configuration. Particularly line 15 with the path to your keystore.
```
15 server.ssl.keyStore=file:/etc/cas/tomcat.keystore
```
Finally, go back to the root of the `cas-user` repo and run the following command to start the server.
```
$ ./build.sh run
```
Now, going back to this folder's repo, run the following command to go to start the REST service.
```
$ gradle bootRun
```
You should now be able to access all the endpoints at [https://localhost:9090](https://localhost:9090). The API docs are available at [https://localhost:9090/swagger-ui.html](https://localhost:9090/swagger-ui.html).
The CAS server has one login entry, username: `casUser`, password: `Mellon`. The server is basic because the project will eventually use GMU's sophisticated CAS server in production.
## Running the tests
### Break down into end to end tests
There are integration tests that test each part of the service separately.
```
$ gradle test
```
### And coding style tests
To be implemented.
```
To be implemented.
```
## Deployment
At the moment, there is no deployment process. I would like to host the service in a Docker image. Possibly have a separate one for the database as well.
## Built With
* [CockroachDB](https://www.cockroachlabs.com/) - Resilient SQL Database
* [Flyway](https://flywaydb.org/) - Database Versioning Tool
* [Gradle](https://gradle.org/) - Dependency Management
* [Jacoco](https://github.com/jacoco/jacoco) - Java Code Coverage tool
* [Spring](https://spring.io/) - Java Framework
* [SonarQube](https://www.sonarqube.org/) - Continuous Code Quality
* [Swagger](https://swagger.io/) - API docs
* [Travis-CI](https://travis-ci.com/) - Platform for automated CI/CD
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Authors
See also the list of [contributors](https://github.com/khalludi/bookshare-backend/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment