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)
Table display of the students added to the system
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.
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.
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)
-
Create docker network
❯ docker network create db 92cc19cc6ef7f64a6387ad0465dc133eefe1c425171c17bb418503a9e5fbcc58 full-stack-spring-boot-react git/edit-favicon* ❯
-
Create a folder to mount
/var/lib/postgresql/data
andcd
to that folderExample: db-data
full-stack-spring-boot-react ❯ cd ~/Desktop/db-data
-
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 ❯
-
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 ❯
-
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=#
Run the following command.
aws elasticbeanstalk terminate-environment --environment-name Fullstackspringbootreact-env
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
- Implement Update Student
- Update implementation of Update Student
- Implement uploading of profile picture
- Planning to turn this into a Player Management System (Sports ⛹️♂️)
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
Distributed under the MIT License. See LICENSE.txt for more information.
Rommel Medina - rommel.d.medina@gmail.com
Project Link: ACME - Student Management System
- Hat tip to anyone whose code was used
- Inspiration
- etc.
- Resources: