Skip to content

ballaprr/TestingCode

Repository files navigation

Engageathon

Table of Contents

  1. Background
  2. Technology
  3. Assignments
  4. Installation
  5. Running
  6. Misc.

Background

  • Engageathon is a software that measures and records engagement for corporations (employee engagement, brand engagement), nonprofits (volunteer engagement), universities (student engagement), and individuals. Users can create and attend events. Attending events earns points which can be redeemed for rewards.

  • iOS, Android applications

  • Figma

  • Features

  • Implemented Features

Technology

Python 3.9.0

  • Django
  • Django REST Framework
  • PostgreSQL
  • SQLite
  • Docker
  • AWS S3
  • AWS EC2
  • Swagger UI

Development Server: https://app.engageathon.com/

Assignments

  1. Please review the existing code structure before you start your assignment. Please ask any and all questions that arise.
  2. Assignments are posted in this github readme under "timeline"

Assignments must be pushed to your own branch by the friday of that week, unless I have been notified otherwise. Once that is complete, please send me status via discord consisting of the following:

1. the feature implemented
2. the test cases verified
3. any test cases not verified
  1. Code reviews occur weekly on friday at 11:30am EST, after which we will merge with main

Installation:

Prerequisites

  • Windows: Install Ubuntu WSL
  • Windows: Docker Desktop: Download
  • Postman: Download
  • Make sure to create a branch
sudo apt update
sudo apt install postgresql postgresql-contrib

Database Setup

  1. Install PostgreSQL:

Start PostgreSQL

sudo systemctl start postgresql

Create Database

CREATE DATABASE Engageathon;
CREATE USER myuser WITH PASSWORD 'mypassword';
ALTER ROLE myuser SET client_encoding TO 'utf8';
ALTER ROLE myuser SET default_transaction_isolation TO 'read commited';
GRANT ALL PRIVILEGES ON DATABASE Engageathon TO myuser;

Change the PostgreSQL configuration files

cd /etc/postgresql/14/main

pg_hba.conf Below the first line for IPv4 local connections add the following

host	all	all	0.0.0.0/0	password

postgresql.conf

listed_addresses = '*'
port = 5432

Restart PostgreSQL

sudo systemctl restart postgresql

Check your IP address and set it to the Database Host

ip addr show

Update Database environment variables shown in Settings.py

If PostgreSQL is not working then comment out the code and uncomment the SQLite related code

Running:

Go to the docker-compose.yml file, replace user with the username of your docker account

Ex:

image: rohanb2800/application:django

For Windows Users ensure you have the docker engine up and WSL integration turned on

Build the image

docker-compose build

To run the application

docker-compose up -d
docker-compose up -d

Make migrations, run

docker ps

to get the id

docker exec -it [container_id] /bin/bash

Within the container

python3 manage.py makemigrations
python3 manage.py migrate

To shut down the container & stop the application run:

docker-compose down

misc.

  1. upload mission categories
INSERT INTO engageathon_api_missioncategory (name) VALUES
('Climate Change Mitigation'),
('Wildlife Protection'),
('Renewable Energy'),
('Sustainable Transportation'),
('Forest Conservation'),
('Marine Conservation'),
('Habitat Restoration'),
('Endangered Species'),
('Ecosystem Preservation'),
('Water Sanitation'),
('Ocean Cleanup'),
('Coral Reef Protection'),
('Smog Reduction'),
('Waste Management'),
('Green Infrastructure'),
('Ocean Cleanup'),
('Carbon Emission Reduction'),
('Land Conservation'),
('Sustainable Agriculture'),
('Sustainable Tourism'),
('Clean Water Initiatives'),
('Circular Economy Practices'),
('Water Scarcity Solutions'),
('Pollution Reduction'),
('River and Lake Conservation'),
('Eco-Friendly Living'),
('Green Building Practices'),
('Clean Air Advocacy'),
('Sustainable Consumption'),
('Industrial Emission Control'),
('Urban Renewal'),
('Plastic Pollution Prevention'),
('Wildlife corridor Protection'),
('Energy Efficiency'),
('Access to Clean Cooking'),
('Sustainable Agriculture'),
('Resource Conservation'),
('Desertification Prevention'),
('Soil Health Improvement'),
('Access to Clean Cooking'),
('Sustainable Mining Practices'),
('Human Rights and Equality'),
('Gender Equality'),
('Racial Justice'),
('LGBTQ+ Rights'),
('Indigenous Peoples'' Rights'),
('Disability Rights'),
('Children''s Rights'),
('Elderly Care and Rights'),
('Human Trafficking'),
('Immigrants Rights'),
('Freedom of Speech'),
('Prison Reform'),
('Black Lives Matter'),
('Gun Control'),
('Health Care Reform'),
('Poverty Alleviation'),
('Income Inequality'),
('Access to Education'),
('Affordable Housing'),
('Fair Wages'),
('Diversity Equity & Inclusion'),
('Accessible Healthcare'),
('Mental Health'),
('Nutrition and Food Security'),
('Maternal and Child Health'),
('HIV/AIDS Prevention and Treatment'),
('Breast Cancer'),
('Abortion'),
('Covid 19'),
('Autism Awareness'),
('Disabilities & Special Needs'),
('Infertility'),
('Education Equity'),
('Adult Literacy Programs'),
('Early Childhood Education'),
('Education for Girls and Women'),
('Vocational Training'),
('Digital Literacy'),
('Entrepreneurship'),
('Financial Literacy'),
('Youth Mentorship'),
('Domestic Violence Prevention'),
('Bullying Prevention'),
('Gun Control Advocacy'),
('Conflict Resolution'),
('Human Trafficking Prevention'),
('Voter Education and Participation'),
('Freedom of Speech'),
('Civic Education'),
('Community Engagement'),
('Humanitarian Aid and Disasters Relief'),
('Climate Change Mitigation'),
('Renewable Energy Adoption'),
('Carbon Emission Reduction'),
('Sustainable Transportation'),
('Circular Economy Practices'),
('Forest Conservation'),
('Wildlife Protection'),
('Marine Conservation'),
('Endangered Species'),
('Habitat Restoration'),
('Ecosystem Preservation'),
('Clean Water Initiatives'),
('Water Sanitation'),
('Ocean Cleanup'),
('Water Scarcity Solutions'),
('Access to Clean Cooking'),
('Unsustainable Consumption'),
('Green Building Practices');
  1. Delete Repetitive Mission categories
DELETE FROM engageathon_api_missioncategory
WHERE id NOT IN (
    SELECT MIN(id)
    FROM engageathon_api_missioncategory
    GROUP BY name
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •