项目作者: edinfazlic
项目描述 :
Real life locations management api.
高级语言: Java
项目地址: git://github.com/edinfazlic/location-api.git
Location Api
This application serves as a backend server exposing several apis for locations management.
Application showcases knowledge of:
- Java programming language
- Javadoc covering services
- Spring framework
- Application setup and initialization
- Annotation utilization
- Controller and Service definition
- Exposed requests mapping
- CRUD (POST, PUT, DELETE, GET)
- Receiving objects as body, path variable and request param
- Dependency injection (on constructor)
- Cross origin handling
- CRUD (Mongo) repository
- Data layer
- Document database (Mongo) setup / NoSQL
- Swagger (for application specification)
- General
- Services defined as interfaces with separate implementation
- REST calls
- GET with request parameters and path variable
- DELETE with path variable
- POST and PUT with body
- Helpers and utility classes with mostly static content
- Having git commit messages readable
- Concepts
- Separation of concerns
- “N-tier architecture”
- Controllers expose api endpoints
- (Business) Logic is found inside services
- Data layer is accessed from repositories
- Operations
- Setting environment variables (for production and development differentiation)
- Deploying application
Requirements
- Java - 11.x
- Maven - 3.x.x
- MongoDB - local database, host: localhost:27017, database: test; or see environment variable under Development server
Development server
- Build and run the backend app using maven
mvn package
java -jar location_api-0.0.1-SNAPSHOT.jar
Alternatively, you can run the app without packaging it, using:mvn spring-boot:run
- Provide MONGODB_URI environment variable, unless using Mongo database found at localhost (default port: 27017)