> For the complete documentation index, see [llms.txt](https://digital-public-goods.gitbook.io/open-source/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://digital-public-goods.gitbook.io/open-source/open-sourcing-your-project/3-bonus-files.md).

# 3 bonus files

These are 3 additional files that a GOOD open source project must have

#### <mark style="color:yellow;">1.</mark> <mark style="color:yellow;">Repository Guide</mark>&#x20;

This guide outlines the purpose that each file in the repository serves. It helps a new user navigate across files and find information.

<details>

<summary>Sample Repo Guide </summary>

This is the repo guide of the DPGA Webapp (Application Portal). It details out all the files found in the repository.&#x20;

### 👋 Hello!

Please find below a list of the main files found in this repository along with an explanation of the purpose they serve.\
\
We hope this helps you navigate through this project better!

#### 📁 Application:

All of the application code for the DPGA Webapp project is contained in this [directory](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/application): it contains the core framework files.\
It is not advised to make changes in this directory or put your own application code into this directory.

#### ✏️ Assets:

[This folder ](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/assets)contains the static content like css, fonts, images, and logo of the DPGA webapp and the Alliance at large.

#### 📘 Files:

When an applicant fills in the application form using the [excel sheet ](https://docs.google.com/spreadsheets/d/1kP7p6OXsdxRyS3nXiXLDPhSCdl6Uy-0Ksmhfh3LKLlk/edit#gid=470783276)then those applications and responses get uploaded [here.](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/files)

#### 🔩 System:

[This folder](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/system) contains CodeIgniter core codes, libraries, helpers and other files, which help make the coding easy.\
These libraries and helpers are loaded and used in web app development.

#### 🔓 Vendor:

[This folder](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/vendor) has third party tools such as the php spreadsheet (to read the excel that applicants use to upload applications)

#### ▶️ Individual files:

i [.Htaccess](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/.htaccess) - Used to manage the web server\
\
ii. [Composer json](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/composer.json) - Used for package management\
\
iii. [Index.php](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/index.php) - Main index file which controls the entire project\
\
iv. [License.txt](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/license.txt) - Stores the MIT License held by this repository.\
\
v. [Readme.rst](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/README.md) - Stores information about the usage, aim and development of the Webapp

</details>

#### <mark style="color:yellow;">2. Tech Architechture</mark>

This file is supposed to give an overview of all the capabilities and functionalities of your project. It is supposed to answer the question: 'What are the features of this project?'

<details>

<summary>Sample Tech Architechture File </summary>

This file contains details of the various capabilities and functionalities of the Digital Public Goods Webapp.\
\
All files being referred to here can be found in the Applications > Controllers folder of this repository. [Here ](https://github.com/DPGAlliance/publicgoods-review-webapp/tree/main/application/controllers)is a quick link.<br>

<mark style="color:yellow;">Admin:</mark> The Admin panel allows the administrators of this program to view graphs and statistics regarding all the applications processed. They get to see the application logs filtered by date, application and individual reviewer. They also manage permissions + access for users, and set time limits for reviewers to process each application. It also allows them to edit answers, reset questions, and change the status of all applications.<br>

<mark style="color:yellow;">API:</mark> The API file manages the site [api.digitalpublicgoods.net ](https://github.com/DPGAlliance/publicgoods-review-webapp/blob/main/api.digitalpublicgoods.net)and all related API.<br>

<mark style="color:yellow;">Crons:</mark> The Crons file automates scheduled tasks. It ensures that applications are marked 'late' automatcially if they have been in a reviewers panel for long, or it will mark an application as 'ineligible' if clarifications are not submitted by the applicant on time.<br>

<mark style="color:yellow;">Expert:</mark> The Expert file helps expert reviewers of the DPGA to give their inputs on particular indicators as required by the DPGA reviewer team. They can only see + respond to what is directly assigned to them.<br>

<mark style="color:yellow;">Applicant:</mark> This file handles all the capabilities of an applicants view of the panel. It allows users to create + submit their application form to be assessed as potential DPGs.<br>

<mark style="color:yellow;">Front Page:</mark> The file contains the landing page requirements of the webapp such as log in + sign up.<br>

<mark style="color:yellow;">General Public:</mark> The General Public file hosts the public URLs of all DPGs.<br>

<mark style="color:yellow;">Reviewers:</mark> The Reviewers file has capabilities which allow reviewers to assess applications - mark them as pass, fail or pass them for consultation and clarifications. It allows them to view their previous decisions taken on any application as well as monitor the logs of time taken.<br>

<mark style="color:yellow;">Users:</mark> This file includes functionalities for Email Verification and Forgot Password.

</details>

#### <mark style="color:yellow;">3. Tech Infrastructure</mark>&#x20;

This file contains information about how to create and deploy the project in a local environment. This is best written by the technical / developer team.&#x20;

<details>

<summary>Sample Tech Infrastructure File </summary>

#### 🔓 <mark style="color:yellow;">Deployment Guide</mark>

\
This guide can be used for a fresh DPGA web app server in the production stage.

\
Step 1 - Create an account AWS / Google cloud / Digital ocean.\
Step 2 - Create an Ubuntu 22.04 instance.\
Step 3 - Now access the ubuntu terminal through SSH keys OR the web terminal.\
\
Step 4 - Now we need to install Apache, PHP, MySql, and PHPMyAdmin. Run the below commands in the ubuntu terminal.

\
sudo apt-get update\
sudo apt-get install zip unzip\
sudo apt-get install apache2\
sudo apt install php libapache2-mod-php\
sudo systemctl restart apache2\
sudo apt install mysql-server\
sudo apt install php-mysql php-gd\
sudo apt-get install phpmyadmin

\
Step 5 - Now we create a database user. Go to MySQL section and run the below command

\
CREATE USER ''@'localhost' IDENTIFIED BY '';\
GRANT ALL PRIVILEGES ON \* . \* TO ''@'localhost';\
FLUSH PRIVILEGES;\
\
Step 6 - As of now PHPMyAdmin is installed on the server but we are unable to access it through the browser.\
\
Use the below commands to access PHPMyAdmin in the browser:\
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf\
sudo a2enconf phpmyadmin.conf\
sudo systemctl restart apache2

\
Now try to access PHPMyAdmin in browser via following URL

\
Step 7 - Now PHPMyAdmin is accessible through the browser. Login with mysql user details which you created in step 5.

\
Step 8 - Now create a database in PHPMyAdmin dashboard and import the sample database file(webapp\_database.sql) which is available in the dpga\_webapp.zip folder(this folder is available in the source code).

\
Step 9 - Now we move our files to webdirectory, unzip our code files to html folder. sudo unzip dpga\_webapp.zip /var/www/html/

\
Step 10 - Now we need to edit a few details(host details, database details, email details) in our code files so the web app runs smoothly.

\
Step 11 - Now all things are completed. Webapp should be running and accessible through server IP. Now we need to map a domain name to this server. So this webapp is also accessible through a domain name. Open DNS settings and add an A record that points out to our server IP. Now wait for 20-30 minutes and after you see that domain hitting our IP address.

\
Step 12 - Now we install the SSL certificate. Here we are installing Let’s Encrypt free certificate which needs to renew every 90 days (renewal can be automated through a cron).\
\
For SSL installation, follow [this guide](https://certbot.eff.org/instructions?ws=apache\&os=ubuntufocal)

\
Step 13 - For the smooth working of all edge cases in the web app we need to run several cron at a specific time. Login as admin and in the menu click on the cron details tab. Here you get an all crons list with time. Set all these crons so web app works as expected.\
\
For cron setup we can follow [this guide](https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-ubuntu-1804)\ <br>

#### 💻 <mark style="color:yellow;">Technical Infrastruture (Production)</mark>

Currently, we use AWS EC2 instance as production server to host the webapp.

Webapp runs on an Ubuntu 22.04 machine with aaPanel for simplifying the hosting on Ubuntu and running commands via a GUI.

Through this GUI Panel, you can easily manage all files, databases, crons, SSL certificates, server details, PHP versions, etc.

Other utilities installed are Apache, PHP, MySql, and PHPMyAdmin

Backend is written via in Codeigniter 3 framework in PHP language.

MySQL used for database

Frontend is developed using the Bootstrap 5 framework.

REST APIs are used to pull data from the database.

Domain and IP Address: app.digitalpublicgoods.net pointing to 15.222.197.93 Using A record on Google Domains

SSL using Let’s Encrypt

Refer comments in the code for explanation of different functions, etc. Variable names are made simple and to the point.

</details>
