Skip to content

This project is about creating a full-stack CRUD application with CI/CD using Github Actions and features the use of the most popular cloud platform today, AWS. (Work in progress)

Notifications You must be signed in to change notification settings

medinar/full-stack-spring-boot-react

Repository files navigation

ACME Student Management System

This project is about creating a full stack CRUD application with CI/CD using Github Actions and features the use of the most popular cloud platform today, AWS. (Work in progress)

Screenshots

Table display of the students added to the system Table display of the students added to the system

Create new student form Create new student form

Update student form Update student form

Delete student confirmation Delete student confirmation

Student deleted notification Student deleted notification

Diagrams

Diagram below shows Maven bundles the front-end and backend application then creates a docker image. The Jib Maven plugin then either builds a local docker image or builds and pushes docker image to docker hub. A docker-compose.yml file contains the reference to the image in the docker hub to be deployed to the AWS. fullstack-spring-react-1

Diagram below shows the docker image uploaded to AWS Elastic Beanstalk Environment. It is now managed inside the ECS Cluster and protected by SG (Security Group). The application inside the EC2 instance has permission to access the AWS RDS PostgreSQL since they reside in the same environment. To grant our local application to access the AWS RDS, an SG must be defined. fullstack-spring-react-2

top ⬆️

Built With

Spring Boot Java React PostgreSQL Docker Github AWS

top ⬆️

Getting Started

Prerequisites

What things you need to install the software and how to install them

[Java 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[Docker](https://www.docker.com/get-started)
[Docker PostgreSQL Image](https://hub.docker.com/_/postgres)
[Intellij](https://www.jetbrains.com/idea/)
[AWS](https://portal.aws.amazon.com/billing/signup#/start)

top ⬆️

Installation

top ⬆️

Usage

Connecting to Docker PostgreSQL

  1. Create docker network

    ❯ docker network create db                                               
    92cc19cc6ef7f64a6387ad0465dc133eefe1c425171c17bb418503a9e5fbcc58
                                                                                                                                                                  
    full-stack-spring-boot-react git/edit-favicon*
  2. Create a folder to mount /var/lib/postgresql/data and cd to that folder

    Example: db-data

    full-stack-spring-boot-react  
    ❯ cd ~/Desktop/db-data               
                                                                                                                                                                  
  3. Run the command below.

    ~/Desktop/db-data   
    ❯ docker run --name db -p 5432:5432 --network=db -v "$PWD:/var/lib/postgresql/data" -e POSTGRES_PASSWORD=password -d postgres:alpine
    b59cfc5db67e861bae4279487e5aea6ff6860915d7b33b78a944903bb53f7d7f                                                                                               
    
    ~/Desktop/db-data   
    ❯
  4. Check if the container is running

    ~/Desktop/db-data   
    ❯ docker ps                                                                                                                         
    CONTAINER ID   IMAGE             COMMAND                  CREATED          STATUS          PORTS                    NAMES
    b59cfc5db67e   postgres:alpine   "docker-entrypoint.s…"   10 minutes ago   Up 10 minutes   0.0.0.0:5432->5432/tcp   db
                                                                                                                                                                  
    ~/Desktop/db-data   
    ❯
  5. Connecting to the DB using PSQL Container

    ~/Desktop/db-data   
    ❯ docker run -it --rm --network=db postgres:alpine psql -h db -U postgres
    Password for user postgres: 
    psql (14.0)
    Type "help" for help.
    
    postgres=# \l
                                     List of databases
       Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
    -----------+----------+----------+------------+------------+-----------------------
     medinardb | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 
     postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 
     template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +
               |          |          |            |            | postgres=CTc/postgres
     template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +
               |          |          |            |            | postgres=CTc/postgres
    (4 rows)
    
    postgres=# \c medinardb
    You are now connected to database "medinardb" as user "postgres".
    medinardb=# \d 
                    List of relations
     Schema |       Name       |   Type   |  Owner   
    --------+------------------+----------+----------
     public | student          | table    | postgres
     public | student_sequence | sequence | postgres
    (2 rows)
    
    medinardb=# 

Terminating the Elastic Beanstalk environment using the AWS CLI

Run the following command.

aws elasticbeanstalk terminate-environment --environment-name Fullstackspringbootreact-env

Terminating the RDS database instance via the AWS CLI

To stop a DB instance by using the AWS CLI, call the stop-db-instance command with the following option:

aws rds stop-db-instance --db-instance-identifier aa7owmyzt7q7ch

DB-INSTANCE

top ⬆️

Roadmap

  • Implement Update Student
  • Update implementation of Update Student
  • Implement uploading of profile picture
  • Planning to turn this into a Player Management System (Sports ⛹️‍♂️)

top ⬆️

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

Fork the Project Create your Feature Branch (git checkout -b feature/AmazingFeature) Commit your Changes (git commit -m 'Add some AmazingFeature') Push to the Branch (git push origin feature/AmazingFeature) Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Rommel Medina - rommel.d.medina@gmail.com

Project Link: ACME - Student Management System

Acknowledgments

top ⬆️

About

This project is about creating a full-stack CRUD application with CI/CD using Github Actions and features the use of the most popular cloud platform today, AWS. (Work in progress)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published