Skip to content

Development of a RESTful API to manage events, built with Spring Boot and deployed on AWS.

License

Notifications You must be signed in to change notification settings

vitorstaub/eventhub-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventsHub

Java SpringBoot AWS

Getting StartedAPI EndpointsAWS DeployReferences

About

This project is an API built using Java, Java Spring, Flyway Migrations, PostgresSQL as the database.

The API emulates the functionality of an event web application similar to UberHub. Users can create and view registered events. The API has been deployed on AWS utilizing an EC2 instance, a RDS PostgreSQL database, and an S3 bucket.

Getting started

Prerequisites

  • Cloning de repository
git clone https://github.com/vitorstaub/eventshub-api.git

Authentication and access credentials - AWS

Environment Variables

application.properties

spring.datasource.url=${AWS_DB_URL:jdbc:postgresql://localhost:5432/postgres}
spring.datasource.username=${AWS_DB_USER:vitorstaub}
spring.datasource.password=${AWS_DB_PASSWORD:password}
aws.region=us-east-1
aws.bucket.name=${BUCKET_NAME}

Starting

- Start the application with Maven

Accessible at

http://localhost:8080

API Endpoints

The API provides the following endpoints:

POST /event - Register a new event.

GET /api/event - Retrieve a list of all events.

GET /api/event/{eventId} - Retrieve a specific event by ID.

AWS Deploy

Image Example

S3 Bucket

  • Create S3 bucket

  • Add Bucket S3 public get policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::BUCKET_NAME/*"
        }
    ]
}

EC2 Instance

CIDR IPv4:

10.0.1.0/24
  • Create a private subnet that uses the first half of the IP addresses in the VPC.

    CIDR IPv4:

10.0.0.0/24

RDS Database

Contributing

When contributing to this project, please follow the existing code style, commit conventions, and submit your changes in a separate branch.

References

AWS Docs

Spring Docs

Fernanda Kipper

About

Development of a RESTful API to manage events, built with Spring Boot and deployed on AWS.

Topics

Resources

License

Stars

Watchers

Forks

Languages