Skip to content

Commit acfa7ea

Browse files
committed
Added initial docs
1 parent dcf50b0 commit acfa7ea

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed
File renamed without changes.

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# VTMUNC Web Application
2+
3+
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.
4+
5+
## Technologies Used
6+
7+
- **Frontend**: React.js, HTML+CSS+JS, and Vite
8+
- **Backend**: Node.js with Express.js framework
9+
- **Containerization**: Docker
10+
- **Continuous Integration/Continuous Deployment (CI/CD)**: GitHub Actions
11+
- **Deployment**: AWS EC2 instance running Ubuntu Linux, AWS DynamoDB for database and setup is done through bash scripts.
12+
13+
## Features
14+
15+
- **User Registration**: Participants can register for the conference through the web application.
16+
- **Committee Information**: Access detailed information about various committees and topics.
17+
- **Benefits Overview**: Learn about the advantages and opportunities available through VTMUNC participation.
18+
19+
## Table Of Contents:
20+
21+
- [🌐 Deployment](docs/deployment.md)
22+
23+
## Contributing
24+
25+
Contributions are welcome! If you'd like to contribute to the project, please fork the repository and submit a pull request.
26+
27+
## License
28+
29+
This project is licensed under the [MIT License](LICENSE).

docs/deployment.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# 🌐 Deployment Guide
2+
3+
## Overview of VTMUNC Website Architecture
4+
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.
5+
6+
## Initial Setup
7+
8+
### Step 1: Create an EC2 Instance
9+
10+
1. **Launch an EC2 Instance**:
11+
- Go to the AWS Management Console and navigate to the EC2 Dashboard.
12+
- Click on "Launch Instance".
13+
- Select "Ubuntu" as the AMI (Amazon Machine Image).
14+
- Choose an instance type (e.g., t2.micro for free tier eligibility).
15+
16+
2. **Configure Instance**:
17+
- **Key Pair**: Create a new key pair or select an existing key pair. This will be used for SSH access.
18+
- **Security Group**: Create a new security group with the following rules:
19+
* Inbound rules:
20+
- Allow SSH on port 22 from ony you and your collaborators ip addresses.
21+
- Allow HTTP on port 80 from anywhere.
22+
- Allow HTTPS on port 443 from anywhere.
23+
* Outbound rules:
24+
- Allow all traffic to a to anywhere
25+
26+
3. **Launch the Instance**: Complete the instance launch process.
27+
28+
### Step 2: Connect to Your EC2 Instance
29+
30+
1. **SSH into the EC2 Instance**:
31+
- Open a terminal on your local machine.
32+
- Run the following command, replacing `<path-to-key-pair>` with the path to your key pair file and `<ec2-user>` and `<public-ip>` with your EC2 instance's username and public IP address:
33+
34+
```bash
35+
ssh -i <path-to-key-pair> <ec2-user>@<public-ip>
36+
```
37+
38+
### Step 3: Run the Initial Setup Script
39+
40+
1. **Execute the Setup Script**:
41+
- 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:
42+
43+
```bash
44+
curl -sSL https://raw.githubusercontent.com/Trafix120/VTMUNC/main/aws/ec2-setup.sh | bash
45+
```
46+
47+
### Step 4: Configure GitHub Runner
48+
49+
1. **Edit the GitHub Runner Configuration**:
50+
- Navigate to your GitHub repository.
51+
- Go to `Settings` > `Actions` > `Runners` > `New self-hosted runner`
52+
- Select the option to configure a new self-hosted runner.
53+
- 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/<Username>/<Repository> --token <Token>
54+
55+
2. **Run the GitHub Runner as a Systemd Daemon**:
56+
- Once configured, execute the following command to run the setup script again, which will configure the GitHub runner to run as a systemd daemon:
57+
58+
```bash
59+
curl -ssL https://github.com/Trafix120/VTMUNC/blob/main/aws/start-githubrunner.sh | bash
60+
```
61+
62+
### Step 5: Create a DynamoDB Table
63+
64+
1. **Create the DynamoDB Table**:
65+
- Navigate to the DynamoDB service in the AWS Management Console.
66+
- Click on "Create table".
67+
- Set the table name to `vtmunc_applicants`.
68+
- Define the primary key (e.g., `_id`) as per your application requirements.
69+
- Click "Create" to create the table.
70+
71+
## Subsequent Deploys
72+
73+
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.
74+
75+
```bash
76+
git add .
77+
git commit -m "Your commit message"
78+
git push origin main
79+
```
80+
81+
That's it! Your deployment process is now automated, and your application will be deployed upon every push to the main branch.

0 commit comments

Comments
 (0)