GithubHelp home page GithubHelp logo

code4socialgood / c4sg-services Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 106.0 12.09 MB

Code for Social Good connects nonprofits and open sources with tech volunteers

License: MIT License

Java 97.22% HTML 2.78%

c4sg-services's People

Contributors

ameepandya avatar arpitsrm avatar bg87 avatar chaitanyas16 avatar code4socialgood avatar dv4quadcore avatar ericfzeng avatar felipealvesgnu avatar harshithagandamalla avatar jeff-ma avatar jekcosty avatar jindong12 avatar joshisayali avatar justindiaw avatar jxwang16 avatar karthijey avatar kulgan avatar mathif92 avatar n-machiavelli avatar oleggio avatar outte avatar rclong1221 avatar ryan-thomas avatar sabrinadowla14 avatar sathiyaneve avatar shobhit-sri avatar tajohnson661 avatar tristanmkernan avatar tsepelevv avatar vitshch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c4sg-services's Issues

Rest API - Project - Create Project

  • Endpoint
    POST /api/projects/add

  • Issue
    Client doesn't pass Project ID when create a project. The follow line throws java.lang.NullPointerException.

image

Rest API - Project - Create Project - Refactor

  • Endpoint
    POST /api/projects/add

  • Requirement

  1. Create a new DTO: CreateProjectDTO.
    The new DTO contains the following fields:
    organizationId: Required
    name: Required
    description
    isRemote: indicate whether this project is remote or local. 'Y' or 'N'
    address1
    address2
    city
    state
    country
    zip

  2. Change the input parameter from Project entity to CreateProjectDTO

  3. Note on Create Timestamp
    In project table, there is a column named created_time. When you insert the project in the table, you need to set created_time to NULL. The new record will then be created with created_time as current timestamp.
    See: https://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html

  • Database Table Mapping

image

Rest API - Slack Chat - Invite Team Member to Join a Channel

Rest API - User - Search - Due 4/23

  • Endpoint
    GET /api/users/search (refactor this existing endpoint)

  • Background
    As shown in the attached wireframe, user could search for volunteers by combination of:
    Keyword
    Skills

  • Current Implementation
    Currently, this endpoint searches users with keyword in userName, firstName or lastName. It accepts three input parameters.

  • Requirement: Refactor Search Project Endpoint

  • Input Parameters
    Keyword: this is a string, this is optional
    Skills list: this is a list, this is optional

  • Business Logic

  1. Search users that satisfy Both criteria of Keyword and Skill List, if they are provided in the input parameters
  2. If neither keyword nor skills list is provided, return all users.
  3. Keyword criteria: search in userName, firstName, lastName, title, introduction, skills
  4. Skills criteria: search is skills (user_skill table)
  5. Sort the result by userName in ascending order.
  • Documentation
    Add the following comments to the endpoint operation:
    notes = Returns a list of users who has the keyword in user name / first name / last name / title / introduction / skills, AND, who has the skills. The search result is sorted by user name in ascending order.

  • Wireframe
    image

Rest API - User - getDevelopers

  • Endpoint
    GET /api/users/developers

  • Requirement

  1. Add a column to user table: c4sg_developer_flg char(1) not null default 'N'

You will need to add two script files in: \c4sg-services-1\src\main\resources\db\migration
file 1: alter user table to add the column
file 2: update user table to set the new column to be 'Y' for some rows

  1. endpoint logic: select * from user where c4sg_developer_flg = 'Y'
  • Note
    There are 3 roles for a user: Volunteer user, Nonprofit user, Admin user
    There is no Developer role.

Rest API - Slack Chat - Create Private Channel

Rest API - Project - Search by Keyword - Order By

Endpoint: GET /api/projects/search/byKeyword/{keyWord}

Requirement:

  1. Sort the search result by create timestamp, in descending order.

  2. Add the following comments to the endpoint operation (serve as Javadoc):
    Searches the keyword in project name and description, case insensitive. The search result is sorted by project create time in descending order.

Rest API - Image/File Upload and Display

The following endpoints are required for front-end to be able to display and upload images and files:

  • GET /api/projects/{id}/image
  • POST /api/projects/{id}/image
  • GET /api/users/{id}/avatar
  • GET /api/users/{id}/resume

User - Add new filed: skill6

  • Requirement
  1. There are 5 skills columns in user table. Add a 6th column: skill6
  2. Refactor relevant Java code to reflect this additional column

Rest API - Organization - Search By Keyword

  • Rest API
    GET /api/organizations/search (already exist)

  • Requirement

  1. In organization table, add a column: project_updated_time, timestamp, not null

  2. Searches the keyword in organization name and description, case insensitive.

  3. The search result is sorted by project update time in descending order. Sorting by project update timestamp ranks the most active organizations on top of research result.

  4. Add the following comments to the endpoint operation (serve as Javadoc):
    Searches the keyword in organization name and description, case insensitive. The search result is sorted by project update time in descending order.

Rest API - Slack Chat - Send Join Team Invitation Email

Best Practice - Restful Service Design Pattern - Create Project as Example

From @Code4SocialGood on February 21, 2017 6:43

Task Description

  1. Research on Rest API design pattern.
  2. Determine whether operations should reuse the same model, or, each operation should have its own model.
  3. Refactor Create Project operation as needed.

Specific Considerations

  1. Parameters should be marked optional or mandatory. Currently all parameters are marked as optional.
  2. ID field does not need to be filled. It is the system generated identity column.
  3. Status field does not need to be filled. It has the default of "A" in the column definition.
  4. Create Time field does not need to be filled. It has the default of CURRENT TIMESTAPM in the column definition.

Copied from original issue: Code4SocialGood/C4SG-Obsolete#295

Rest API - Project/User/Organization - Create Timestamp

  • End Points
    POST /api/projects/add
    POST /api/organization/create
    POST /api/users

  • Requirement

  1. The tables have created_time column. This column has no default value. When a new record is inserted, explicitly set the value of created_at column to be null.
    Sample statement: insert into project (name, description, created_time) values ('project test', 'project test', null)
  2. Renaming the 3 endpoints to follow the same naming standard.

Research on Connection Pool

From @Code4SocialGood on February 21, 2017 16:18

  • Background
    We are currently using Hibernate default connection pool.
    It is recommended to use a third party pool for best performance and stability.
    One candidate of third party tool is C3P0

  • Task

  1. Research on connection pool: whether to use Hibernate default or thirt party
  2. Research on performance test: How to test and compare the performance of the different connection pools? By a load runner tool or script?

If decide to use third party tool:

  1. Decide which one to choose
  2. Implement it
  3. Test and compare the performance
  • Reference
  1. http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html
  2. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html
    29.1.2 Connection to a production database

Copied from original issue: Code4SocialGood/C4SG-Obsolete#303

Rest API - Organization - Create Organization [Due 3/6]

From @Code4SocialGood on February 20, 2017 18:27

  • Rest API

/api/organization/create

  • Requirement
  1. "id" is an system generated identity column. This field should not be exposed in the API.
  2. "name" is a mandatory field. But API marks it as optional.
  3. "status" is a column of not null with default 'A'. This fields should not be exposed in the API. the row will be inserted with default vallue of 'A' (active).
  4. "createdate" column does not exist in database table, due to a pending task of #129 Implement database auditing with Envers. Nobody is working on that task yet. Maybe we could just comment out this "createdate" field in Rest API, until we figure out what to do with Envers.
  5. The following fields need to be exposed to API: url, city, zip, contact_name, contact_phone, contact_email. (Note: UI needs to be refactored to provide fields for user to enter these information)
  • Reference - database table

image

  • Reference - Rest API

image

Copied from original issue: Code4SocialGood/C4SG-Obsolete#290

MySQL - Generate ERD and Data Dictionary

From @Code4SocialGood on January 15, 2017 7:35

Generate ERD

Generate Data Dictionary

Timeline
We implement weekly sprint. This task is given a default of one week. You don't have to finish all requirements in this task, but please upload whatever you have by 2/28. This helps us get the latest development status and plan the next sprint efficiently.

Copied from original issue: Code4SocialGood/C4SG-Obsolete#109

My Profile Page - Rest API [Due 3/1]

From @Code4SocialGood on February 22, 2017 15:49

  • Web Path
    Home Page -> John Doe -> My Profile

  • Problem Description
    Some of the fields are missing from backend

  • Task Description

  1. Add following fields to "user" table

    Field Name
    Introduction
    LinkedIn URL
    Personal Web Site
    Resume
    Skill 1
    Skill 2
    Skill 3
    Skill 4
    Skill 5

    Column Definition
    String, nullable, no default

    Here is instruction on how to make database change
    https://drive.google.com/drive/folders/0B-ZVdTdfgx4IZGJVM0FTbU5ZeFk

  2. Expose those fields to Rest API

  • Timeline
    We implement weekly sprint. This task is given a default of one week. You don't have to finish all requirements in this task, but please submit a Pull Request with whatever code change you have by 3/1. This helps us get the latest development status and plan the next sprint efficiently.

  • Reference: Current Model

UserDto {
country (string, optional),
displayFlag (string, optional),
email (string, optional),
firstName (string, optional),
github (integer, optional),
id (integer, optional),
lastName (string, optional),
latitude (string, optional),
longitude (string, optional),
phone (string, optional),
role (string, optional),
state (string, optional),
status (string, optional),
userName (string, optional),
zip (string, optional)
}

Copied from original issue: Code4SocialGood/C4SG-Obsolete#307

Rest API - Skills

  • Requirement
    Refactor the endpoint: GET /api/skills/all

  • Business Logic
    select s.skill_name, count(*) as total
    from user_skill us
    join skill s on us.skill_id = s.id
    group by us.skill_id
    order by total desc

Database - Create Database Scripts

Create two database scripts

  1. Create all tables
    You can generate the DDL from the existing c4sg schema
    Always have DROP TABLE statement before CREATE TABLE
  2. Load all test data

Rest API - Project - Bookmark a Project

Controller: Project Controller
Endpoint: /api/projects/bookmark/projects/{projectId}/users/{userId}
Implementation: Insert a row in user_project table, status = 'B'

Rest API - Home Controller - Remove

Do we need HomeController and operations in it?

  • If no, remove it.
  • If yes, explain why.

HomeController:
DELETE /home
GET /home
HEAD /home
OPTIONS /home
PATCH /home
POST /home
PUT /home

Rest API - Slack Chat - Whether User Joined Slack Room

RestAPI - User - Get Developers

  • Endpoint
    GET /api/users/developers
    This endpoint returns a list of C4SG developers. This list of users will be displayed in About Us page.

  • Requirement
    Retrieve the users who are c4sg developers (developer_flag=Y), and who also set their public profile to be true (public_profile_flag=Y). sort the users by their Github commit in descending order.

SELECT * 
FROM USER 
WHERE DEVELOPER_FLAG = 'Y' 
AND PUBLIC_PROFILE_FLAG = 'Y'
ORDER BY DEVELOPER_COMMIT DESC
  • Documentation
    Add the following comments to the endpoint operation (serve as Javadoc):
    notes = Retrieve the users who are c4sg developers and who set their public display to be true. Sort the users by their Github commits in descending order.

Database - Table Structure Auditing

Review the database structure and modify as needed.

  • Naming of tables and columns should be consistent
  • Adequate data type is used
  • Determine the nullable and default value for each column. In the first iteration, we will determine based on common sense. In later iteration, we will revisit after business requirement is done.

Database - SKILL table - data reload

Reload SKILL table with data below:

HTML/CSS
JavaScript
Java
Python
C++
PHP
Ruby
SQL
Wordpress
Drupal
SEO
Android
iOS
UI/UX Design
Graphic Design
Project Management
Business Analysis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.