Commit d44dcecd authored by aray's avatar aray

initial commit

parent 35f95ba0
{
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "DNS_NAME",
"Type": "CNAME",
"TTL": 60,
"ResourceRecords": [
{
"Value": "DNS_VALUE"
}
]
}
}
]
}
\ No newline at end of file
{
"Changes": [
{
"Action": "DELETE",
"ResourceRecordSet": {
"Name": "DNS_NAME",
"Type": "CNAME",
"TTL": 60,
"ResourceRecords": [
{
"Value": "DNS_VALUE"
}
]
}
}
]
}
\ No newline at end of file
FROM openjdk:17-alpine
ADD /target/playground-assessment-demo-0.0.1-SNAPSHOT.jar //
ENTRYPOINT ["java", "-jar", "/playground-assessment-demo-0.0.1-SNAPSHOT.jar"]
# Getting Started
# Springboot 3.0.2 with MongoDB 5.0
### Reference Documentation
For further reference, please consider the following sections:
## Overview
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.7/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.7/maven-plugin/reference/html/#build-image)
* [Spring Web](https://docs.spring.io/spring-boot/docs/2.7.7/reference/htmlsingle/#web)
* [Spring Data MongoDB](https://docs.spring.io/spring-boot/docs/2.7.7/reference/htmlsingle/#data.nosql.mongodb)
This template is designed in-order to give you best experience to start your coding without doing any addition configuration.
### Guides
The following guides illustrate how to use some features concretely:
Candidates are requested to push your changes to remote repository as soon as possible so that respective TA/Coach can review it and provide the feedback to move you to the next level.
```
pre-requisite
```
1. Docker need to be installed in your local system to enable you to build your code locally and deploy in docker container.
````
Steps to be flowed
````
1. Implement your use-case and add Junit test case.
2. ensure that your code is running locally in local docker container.
3. Dockerfile and docker-compose files available at project root directory.[no need to make any changes in Docker/docker-compose]
````
Command :
1. mvn clean install
2. docker compose up --build
3. docker ps; // check that your container is up and running
````
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [Accessing Data with MongoDB](https://spring.io/guides/gs/accessing-data-mongodb/)
version: "3"
services:
mongodbs:
image: mongo:5.0
container_name: "mongodbs"
ports:
- 27017:27017
api:
build: .
ports:
- 1099:1099
depends_on:
- mongodbs
environment:
spring.data.mongodb.host: mongodbs
......@@ -11,11 +11,11 @@
<groupId>com.altimetrik</groupId>
<artifactId>demo</artifactId>
<artifactId>playground-assessment-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlaygroundCandidateDemo</name>
<description>PlaygroundCandidateDemo</description>
<name>PlaygroundAssessmentDemo</name>
<description>PlaygroundAssessmentDemo</description>
<properties>
<java.version>1.8</java.version>
......
package com.altimetrik.controllers;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/hello")
public class Hello {
@GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.ALL_VALUE)
public ResponseEntity<String> getUserDetailByGitlabEmailId() {
return new ResponseEntity<>("Wecome to Playground...", HttpStatus.OK);
}
}
package com.altimetrik;
package com.altimetrik.playground.candidate.assessment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
@SpringBootApplication
public class Application {
@Slf4j
public class PlaygroundAssessmentDemoApplication {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
SpringApplication.run(PlaygroundAssessmentDemoApplication.class, args);
}
}
package com.altimetrik.playground.candidate.assessment.controller;
public class AdminDbConsoleController {
}
\ No newline at end of file
package com.altimetrik.playground.candidate.assessment.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Data
@Document(collection = "user_details")
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserDataEntity {
@Id
public String id;
public String firstName;
public String lastName;
}
package com.altimetrik.playground.candidate.assessment.repository;
import java.util.List;
import com.altimetrik.playground.candidate.assessment.entity.UserDataEntity;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface UserDataRepository extends MongoRepository<UserDataEntity, String> {
public UserDataEntity findByFirstName(String firstName);
public List<UserDataEntity> findByLastName(String lastName);
}
\ No newline at end of file
swagger.enable=true
k8s.db.env=db-config-k8s
server.servlet.contextPath=/
server.port=1099
spring.data.mongodb.host=mongodbs
# Spring properties
spring:
application:
name: PlaygroundCandidateDemo # Service registers under this name
name: PlaygroundAssessmentDemo
freemarker:
enabled: false # Ignore Eureka dashboard FreeMarker templates
enabled: false
# HTTP Server
server:
port: 1099 # HTTP (Tomcat) port
port: 1092 # HTTP (Tomcat) port
servlet.contextPath: /
undertow:
accesslog:
undertow:
accesslog:
enabled: true
# Logging configurations
......@@ -24,5 +22,6 @@ logging:
org.springframework.security: INFO
org.hibernate.SQL: WARN
article:
fileName : validator.json
\ No newline at end of file
jasypt:
encryptor:
password: playground
[
{
"id": 1,
"title": "SAMPLE APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 1,
"createdBy": "ssa3410@altimetrik.com",
"createdDate": "01-12-2018",
"updatedBy": null,
"updatedDate": null
},
{
"id": 2,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 2,
"createdDate": "01-12-2018",
"createdBy": "pg-ta@altimetrik.com",
"updatedDate": null,
"updatedBy": null
},
{
"id": 3,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 0,
"createdDate": "01-12-2018",
"createdBy": "pg-ta@altimetrik.com",
"updatedDate": null,
"updatedBy": null
}
]
\ No newline at end of file
package com.altimetrik;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ApplicationTests {
}
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