# pageteller **Repository Path**: cesul/pageteller ## Basic Information - **Project Name**: pageteller - **Description**: pageteller - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-17 - **Last Updated**: 2025-04-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PageTeller A Spring Boot application that uses Spring Data MongoDB to connect to a MongoDB database named "storydb" and save Java class objects/models to collections. ## Project Structure - `model/Page.java`: The Page model class with fields like page_id, page_num, content, etc. - `repository/PageRepository.java`: MongoDB repository interface for the Page model - `service/PageService.java`: Service class with business logic for Page operations - `controller/PageController.java`: REST controller exposing endpoints for Page operations - `config/MongoDBConfig.java`: MongoDB configuration with sample data initialization ## MongoDB Configuration The application is configured to connect to a MongoDB database named "storydb" running on localhost:27017. The configuration is in `application.properties`. ## API Endpoints - `GET /api/pages`: Get all pages - `GET /api/pages/{id}`: Get a page by its ID - `GET /api/pages/pageId/{pageId}`: Get a page by its pageId - `GET /api/pages/pageNum/{pageNum}`: Get a page by its pageNum - `POST /api/pages`: Create a new page - `PUT /api/pages/{id}`: Update an existing page - `DELETE /api/pages/{id}`: Delete a page ## Running the Application 1. Make sure MongoDB is running on localhost:27017 2. Run the application using Maven: `./mvnw spring-boot:run` 3. The application will start on port 8080 ## Sample Data The application initializes with two sample pages when started. ## Requirements - Java 17 - MongoDB - Maven