πŸ’ 3 bonus files

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

1. Repository Guide

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

Sample Repo Guide

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

πŸ‘‹ 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: 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 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 then those applications and responses get uploaded here.

πŸ”© System:

This folder 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 has third party tools such as the php spreadsheet (to read the excel that applicants use to upload applications)

▢️ Individual files:

i .Htaccess - Used to manage the web server ii. Composer json - Used for package management iii. Index.php - Main index file which controls the entire project iv. License.txt - Stores the MIT License held by this repository. v. Readme.rst - Stores information about the usage, aim and development of the Webapp

2. Tech Architechture

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?'

Sample Tech Architechture File

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 is a quick link.

Admin: 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.

API: The API file manages the site api.digitalpublicgoods.net and all related API.

Crons: 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.

Expert: 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.

Applicant: 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.

Front Page: The file contains the landing page requirements of the webapp such as log in + sign up.

General Public: The General Public file hosts the public URLs of all DPGs.

Reviewers: 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.

Users: This file includes functionalities for Email Verification and Forgot Password.

3. Tech Infrastructure

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.

Sample Tech Infrastructure File

πŸ”“ Deployment Guide

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

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

πŸ’» Technical Infrastruture (Production)

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.

Last updated