Skip to content

A Dockerised Spring Boot MVC API Server w/ AWS Cognito API

Notifications You must be signed in to change notification settings

soonann/travel-app-backend

Repository files navigation

Travel App Backend

A Dockerised Spring Boot MVC API Server with AWS Cognito API

Overview

This application is a backend service, some of the frameworks/dependencies in this project are:

  • Spring Boot MVC
  • PostgreSQL
  • Docker
  • Docker Compose
  • AWS Cognito API (production)
  • AWS ECS (production)
  • AWS RDS (production)

Contributors

System Design

Solution Architecture

Work-In-Progress

Database Entity Relation Diagram

Installation

Take note that the main branch is a local version of the project, where the database resides locally in your docker as a container.

Furthermore, the main branch does not have the AWS Cognito API implemented, this is to facilitate faster testing of the endpoints locally.

To see a version with the AWS Cognito API implemented, you can refer to the production branch. The production version has CI/CD configured to deploy on AWS ECS to the endpoint https://travel.potatovault.com

Prerequisites

To be able to run this project, you will need to install:

After installing, open up your command line of choice and type in the follow commands to check if docker has been installed properly:

$ docker --version 
Docker version 20.10.16

If you encounter any issues, you can refer to the Troubleshooting Section.

Configurations

If you wish to use the production version of this project, you will need to fill up the example-production.env file.

Take note that the environment file's values will determine the naming of the database and connection credentials.

# example-main.env
DATABASE_HOST=travel-app-db
DATABASE_SCHEMA=public
DATABASE_PORT=5432
POSTGRES_DB=travel-app
POSTGRES_USER=travel-app-user
POSTGRES_PASSWORD=travel-app-password

Usage

This section covers how to use the project with docker compose

Docker Compose

To start the project:

# start project with docker compose
$ docker compose up

To stop the project:

# <Ctrl + C> to exit the running project
$ docker compose down

Docker (Optional)

Alternatively, you may use docker to start the project.

The image is available on Docker Hub here

Troubleshooting

If you get one of the following errors (depending on your terminal) while running any of the commands, you might need to add one or more of the dependencies installed above to PATH:

# cmd - windows
<command> is not recognized as an internal or external command, operable program or batch file.

# mac - zsh
zsh: command not found: <command>

# bash - linux
bash: <command>:command not found

Roadmap

  • Implement Data JPA Models
  • Create Controller, Service & Repository Layers
  • Implement robust validation
  • Integration with AWS RDS
  • Integration with AWS Cognito API
  • Dockerise the Application
  • Deployment to AWS ECS
  • Configuration of GH Actions for CI/CD to AWS ECS

Further development for this project has stopped as it has outran its purpose. Feel free to clone/fork the project and build ontop of it as your own.

Contact

If you encounter any issues, feel free to raise an issue or email me at soonann.dev@gmail.com

Coffee > Food ☕

If this project has helped you in anyway, feel free to buy me a coffee!

Buy Me a Kopi O at ko-fi.com