From acfa7ea21fc72fa266c69b3534435b144da7a2e3 Mon Sep 17 00:00:00 2001 From: Erland A Syafiq Date: Sun, 2 Jun 2024 22:23:07 -0400 Subject: [PATCH] Added initial docs --- dotnet-archive/LICENSE => LICENSE | 0 README.md | 29 +++++++++++ docs/deployment.md | 81 +++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) rename dotnet-archive/LICENSE => LICENSE (100%) create mode 100644 README.md create mode 100644 docs/deployment.md diff --git a/dotnet-archive/LICENSE b/LICENSE similarity index 100% rename from dotnet-archive/LICENSE rename to LICENSE diff --git a/README.md b/README.md new file mode 100644 index 0000000..5cb6f35 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# VTMUNC Web Application + +The VTMUNC web application serves as the online platform for the Virginia Tech Model United Nations Conference. It provides a centralized space for participants and delegates to register, access committee information, and discover the benefits of joining VTMUNC. + +## Technologies Used + +- **Frontend**: React.js, HTML+CSS+JS, and Vite +- **Backend**: Node.js with Express.js framework +- **Containerization**: Docker +- **Continuous Integration/Continuous Deployment (CI/CD)**: GitHub Actions +- **Deployment**: AWS EC2 instance running Ubuntu Linux, AWS DynamoDB for database and setup is done through bash scripts. + +## Features + +- **User Registration**: Participants can register for the conference through the web application. +- **Committee Information**: Access detailed information about various committees and topics. +- **Benefits Overview**: Learn about the advantages and opportunities available through VTMUNC participation. + +## Table Of Contents: + +- [🌐 Deployment](docs/deployment.md) + +## Contributing + +Contributions are welcome! If you'd like to contribute to the project, please fork the repository and submit a pull request. + +## License + +This project is licensed under the [MIT License](LICENSE). \ No newline at end of file diff --git a/docs/deployment.md b/docs/deployment.md new file mode 100644 index 0000000..c507d50 --- /dev/null +++ b/docs/deployment.md @@ -0,0 +1,81 @@ +# 🌐 Deployment Guide + +## Overview of VTMUNC Website Architecture +The VTMUNC website is hosted on an Amazon EC2 instance, which serves as the core infrastructure for the web application. This EC2 instance also functions as a reverse proxy, efficiently managing incoming traffic to ensure smooth and secure operations. Additionally, the server interacts with AWS DynamoDB, providing scalable and rapid access to the database for handling data-related tasks. + +## Initial Setup + +### Step 1: Create an EC2 Instance + +1. **Launch an EC2 Instance**: + - Go to the AWS Management Console and navigate to the EC2 Dashboard. + - Click on "Launch Instance". + - Select "Ubuntu" as the AMI (Amazon Machine Image). + - Choose an instance type (e.g., t2.micro for free tier eligibility). + +2. **Configure Instance**: + - **Key Pair**: Create a new key pair or select an existing key pair. This will be used for SSH access. + - **Security Group**: Create a new security group with the following rules: + * Inbound rules: + - Allow SSH on port 22 from ony you and your collaborators ip addresses. + - Allow HTTP on port 80 from anywhere. + - Allow HTTPS on port 443 from anywhere. + * Outbound rules: + - Allow all traffic to a to anywhere + +3. **Launch the Instance**: Complete the instance launch process. + +### Step 2: Connect to Your EC2 Instance + +1. **SSH into the EC2 Instance**: + - Open a terminal on your local machine. + - Run the following command, replacing `` with the path to your key pair file and `` and `` with your EC2 instance's username and public IP address: + + ```bash + ssh -i @ + ``` + +### Step 3: Run the Initial Setup Script + +1. **Execute the Setup Script**: + - Run the following command to execute the initial setup script. This will set up your reverse proxy and do the initial setups for the github runners: + + ```bash + curl -sSL https://raw.githubusercontent.com/Trafix120/VTMUNC/main/aws/ec2-setup.sh | bash + ``` + +### Step 4: Configure GitHub Runner + +1. **Edit the GitHub Runner Configuration**: + - Navigate to your GitHub repository. + - Go to `Settings` > `Actions` > `Runners` > `New self-hosted runner` + - Select the option to configure a new self-hosted runner. + - Most of the commands have already been done in the ec2-setup.sh script but you need to run the config script, which is unique to each repository. It should look like this: ./config.cmd --url https://github.com// --token + +2. **Run the GitHub Runner as a Systemd Daemon**: + - Once configured, execute the following command to run the setup script again, which will configure the GitHub runner to run as a systemd daemon: + + ```bash + curl -ssL https://github.com/Trafix120/VTMUNC/blob/main/aws/start-githubrunner.sh | bash + ``` + +### Step 5: Create a DynamoDB Table + +1. **Create the DynamoDB Table**: + - Navigate to the DynamoDB service in the AWS Management Console. + - Click on "Create table". + - Set the table name to `vtmunc_applicants`. + - Define the primary key (e.g., `_id`) as per your application requirements. + - Click "Create" to create the table. + +## Subsequent Deploys + +For subsequent deployments, simply push your changes to the `main` branch of your GitHub repository. The configured GitHub Actions workflow will automatically deploy the updates. + +```bash +git add . +git commit -m "Your commit message" +git push origin main +``` + +That's it! Your deployment process is now automated, and your application will be deployed upon every push to the main branch. \ No newline at end of file