This project is a REST API built with Spring Boot for managing Streams, Posts, and Users. It uses MongoDB as the database and integrates AWS Cognito for secure authentication and authorization via OAuth2 and OpenID Connect.
These instructions will help you set up and run the project on your local machine for development and testing purposes.
- Java 17 or later
- Maven installed
- AWS Cognito configured for OAuth2 authentication
$ mvn spring-boot:run/src/main/java/co/edu/eci/arep/x
│── controller # REST Controllers
│── model # Data Models
│── repository # Database Access Interfaces
│── service # Business Logic Layer
│── security # Security Configurations (OAuth2, JWT, etc.)
│── Application.java # Main Entry Point of the Application
GET /posts- Retrieve all posts.GET /posts/stream/{streamId}- Retrieve posts from a specific stream.POST /posts- Create a new post.DELETE /posts/{id}- Delete a post by ID.
POST /streams- Create a new stream.GET /streams- Retrieve all streams.GET /streams/{id}- Retrieve a stream by ID.POST /streams/{id}/posts- Add a post to a stream.GET /streams/{id}/posts- Retrieve all posts from a stream.DELETE /streams/{id}- Delete a stream by ID.
GET /users/me- Retrieve authenticated user details.GET /users/{username}- Retrieve a user by username.GET /users/id/{id}- Retrieve a user by ID.POST /users- Create a new user.
This project implements authentication using AWS Cognito with OAuth2 and OpenID Connect (OIDC).
- The user logs in through AWS Cognito.
- The API verifies the identity and issues an access token.
- Endpoints that require authentication validate the token before granting access.
Run the application locally using Maven:
$ mvn spring-boot:runTo deploy on AWS, follow these steps:
- Build the project:
$ mvn clean package
- Upload the generated JAR file to an AWS EC2 instance or AWS Elastic Beanstalk.
- Configure environment variables and security groups.
- Run the application on the AWS instance.
Watch the deployment in action
- Spring Boot - Framework for building Java applications.
- MongoDB - NoSQL database.
- AWS Cognito - Authentication and security.
- Lombok - Reduces boilerplate code.
- Maven - Dependency management and build tool.
Mateo Forero - Initial work - MateoSebF Juan Daniel Murcia - #Initial work" - murcia0421
This project is licensed under the MIT License.