Userverse is a Java-based application that uses Spring Boot and MongoDB. The project is built using Maven and is containerized using Docker. This project provides an API for data analysis.
- Java 17
- Maven
- Docker (optional, for containerization)
The application configuration is managed through YAML files. The main configuration file is application.yaml
, and environment-specific configurations can be found in files like application-dev.yaml
.
server:
port: ${PORT:2000}
spring:
application:
name: userverse
profiles:
active: ${PROFILE:dev}
spring:
data:
mongodb:
database: ${MONGODB_DATABASE:userverse}
uri: ${MONGODB_URI:mongodb://localhost:27017}}
spring:
data:
mongodb:
database: ${MONGODB_DATABASE}
uri: ${MONGODB_URI}
To build the project, run the following command:
./mvnw clean install
To run the application, use the following command:
./mvnw spring-boot:run
The project includes a Dockerfile
for containerization.
To build the Docker image, run:
docker build -t userverse .
To run the Docker container, use:
docker run --name my_userverse -p 2000:2000 -e MONGODB_URI=mongodb://host.docker.internal:27017 userverse
GET /user
: Retrieves a list of users.GET /user/{id}
: Retrieves a user by ID.GET /user/profile/{userid}
: Get user profile by ID.GET /user/preference/{userid}
: Get user preferences by ID.POST /user/preference/{userid}
: Create a user preference.
The .gitignore
file is configured to exclude build directories and IDE-specific files.
This project is licensed under the MIT License. See the LICENSE
file for details.