Skip to content

Latest commit

 

History

History
331 lines (263 loc) · 14.7 KB

development.md

File metadata and controls

331 lines (263 loc) · 14.7 KB

Development of Persistamp

This section details the technical aspects of this project's development.
To learn what Persistamp is, its features, and how to use it, see the README.

TOC
TechnologiesConceptModelsRoutesWireframesDev SnapshotsContact

Technologies

  • LANGUAGES JavaScript, Python 3, CSS
  • FRONTEND React, React Router
  • BACKEND Flask, SQLAlchemy, PostgreSQL
  • TOOLS Docker, Heroku, Visual Studio Code, Kanban,
  • LIBRARIES recharts, beautiful-react-dnd, react-calendar-heatmap, react-heatmap-grid, FontAwesome, Material-UI, Chakra-UI, Flask-WTF, WTForms, Mashmallow-SQLAlchemy, Werkzeug

Concept

NAME IDEAS PersiStamp or Persistamp (Persistent/Stamp)

LOGO A turtle stamp

AESTHETIC, KEYWORDS Colorful but modern. Analog-feel of paper, stamps, traditional materials, sticky notes/journals, 'reward boards', et cetera? Chalkboard?

FONTS Berkshire Swash (Google), Cambria (headers), Calibri...

COLOR SCHEME Colorful and friendly. Accommodate any color scheme well to allow user flexibility, since they can customize the color and look of a lot of the visual elements of the site.

The database schema evolved and changed quite a bit continually throughout the process to accommodate new ideas, cleaner pipelines, and future features. A few examples exist of the schemas we drew up during the process, but likely by the time of this reading, the models written here are somehow out of date.

Original Schema and a Mid-development Schema

Schema of database tables Schema of database tables

users

users Constraints
id SERIAL, PRIMARY KEY
first_name VARCHAR(25) NOT NULL
last_name VARCHAR(25) NOT NULL
username VARCHAR(25) NOT NULL
birthday DATE
email VARCHAR(320), NOT NULL, UNIQUE
hashword VARCHAR(255) NOT NULL
color_id FOREIGN KEY(colors.id), NOT NULL
stamp_id FOREIGN KEY(stamps.id), NOT NULL
pids_order ARRAY(INTEGER), NOT NULL, DEFAULT VALUE=[]
is_private BOOLEAN, NOT NULL, DEFAULT VALUE=False
created_at TIMESTAMP, NOT NULL, DEFAULT VALUE=new Date()

programs

columns Constraints
id SERIAL, PRIMARY KEY
title VARCHAR(25), NOT NULL
description VARCHAR(250)
color_id FOREIGN KEY(colors.id), NOT NULL
stamp_id FOREIGN KEY(stamps.id), NOT NULL
aids_order ARRAY(INTEGER), NOT NULL, DEFAULT VALUE=[]
rew_ids_order ARRAY(INTEGER), NOT NULL, DEFAULT VALUE=[]
is_private BOOLEAN, NOT NULL, DEFAULT VALUE=False
creator_id INTEGER, FOREIGN KEY=users.id, NOT NULL
created_at TIMESTAMP, NOT NULL, DEFAULT VALUE=new Date()

memberships

columns Constraints
id SERIAL, PRIMARY KEY
program_id INTEGER, FOREIGN KEY=programs.id, NOT NULL
member_id INTEGER, FOREIGN KEY=users.id, NOT NULL
stamper_id INTEGER, FOREIGN KEY=users.id
points INTEGER, NOT NULL, DEFAULT VALUE=0

activities

activities Constraints
id SERIAL, PRIMARY KEY
title VARCHAR(25), NOT NULL
description VARCHAR(250)
frequency INTEGER, NOT NULL, DEFAULT VALUE=1
color_id FOREIGN KEY(colors.id), NOT NULL
stamp_id FOREIGN KEY(stamps.id), NOT NULL
program_id INTEGER, FOREIGN KEY=programs.id, NOT NULL
creator_id INTEGER, FOREIGN KEY=users.id, NOT NULL
created_at TIMESTAMP, NOT NULL, DEFAULT VALUE=new Date()

stamps

columns Constraints
id SERIAL, PRIMARY KEY
date DATE, NOT NULL
status VARCHAR(25), NOT NULL, DEFAULT VALUE="unstamped"
member_id INTEGER, FOREIGN KEY=users.id, NOT NULL
activity_id INTEGER, FOREIGN KEY=activities.id, NOT NULL

rewards

columns Constraints
id SERIAL, PRIMARY KEY
type VARCHAR(25), DEFAULT VALUE="custom"
title VARCHAR(50), NOT NULL
description VARCHAR(250)
cost INTEGER, NOT NULL, DEFAULT VALUE=5
color_id FOREIGN KEY(colors.id), NOT NULL
stamp_id FOREIGN KEY(stamps.id), NOT NULL
limit_per_member INTEGER, NOT NULL, DEFAULT VALUE=-1
quantity INTEGER, NOT NULL, DEFAULT VALUE=1
program_id INTEGER, FOREIGN KEY=programs.id
creator_id INTEGER, FOREIGN KEY=users.id
created_at TIMESTAMP, DEFAULT VALUE=new Date()

receipts

user_rewards Constraints
id SERIAL, PRIMARY KEY
user_id INTEGER, FOREIGN KEY=users.id, NOT NULL
reward_id INTEGER, FOREIGN KEY=rewards.id, NOT NULL
created_at TIMESTAMP, DEFAULT VALUE=new Date(), NOT NULL

bonds

columns Constraints
id SERIAL, PRIMARY KEY
user_id INTEGER, FOREIGN KEY=users.id, NOT NULL
buddy_id INTEGER, FOREIGN KEY=users.id, NOT NULL

Routes

Frontend

METHOD Route Path Purpose
GET / splash page, if no auth
GET / user homepage, if auth checks
GET /about about page
GET /logout logout user
GET /activities/:hid/memberships/:mid activity history page for a user's activity (public/private options)
GET /programs/:pid/memberships/:mid/rewards reward shop for a user and program

Backend

ROOT: /users

METHOD Route Path Purpose
POST / Validate signup and make new user account.
GET /:uid Get user information
PATCH /:uid Authenticate and edit user details
DELETE /:uid Delete a user account
GET /:uid/auth Not sure, but I think we may need a route just to check auth?
GET /:uid/programs Get all a user's subscribed programs.
GET /:uid/receipts Get all a user's redeemed rewards.

ROOT: /programs

METHOD Route Path Purpose
POST / Create a new program.
GET /:pid Get a program's details.
PATCH /:pid Edit a program.
DELETE /:pid Delete a program.
GET /:pid/stampers Get all a program's stampers.
GET /:pid/stampers/:uid Get a specific stamper and the member(s) they are accountable for.

ROOT: /programs/:pid/members

METHOD Route Path Purpose
GET / Get a program's members.
POST /:uid Add a member to the program.
DELETE /:uid Delete a member from the program.
GET /:uid/activities Get a member's activitys for a program, including last seven days of history for each.
GET /:uid/activities/:hid Get a user activity's details, including full history (via stamp_checks)
GET /:uid/stamper Get a member's stamper in the program.
PATCH /:uid/stamper Change a member's stamper in the program.
DELETE /:uid/stamper Unassign the assigned stamper.

ROOT: /programs/:pid/activities

METHOD Route Path Purpose
GET / Get all a program's activities, including last seven days of history for each.
GET /:hid Get a activity's details, including full histories for from all members (via stamp_checks)
POST / Create a activity for a program.
PATCH /:hid Edit a activity for a program.
DELETE /:hid Delete a activity for a program.

ROOT: /programs/:pid/activities/:hid/members/:uid

METHOD Route Path Purpose
POST /stamp Change status of associated daily_stamp to 'stamped'
DELETE / Change status of associated daily_stamp to 'unstamped'
POST /ping Change status of associated daily_stamp to 'pending'

ROOT: /rewards

METHOD Route Path Purpose
GET / Get all default rewards.
GET /:type Get all rewards of a specific type.

ROOT: /programs/:pid/rewards

METHOD Route Path Purpose
GET / Get all a program's custom rewards.
POST / Create a new custom reward.
PATCH /:rid Edit a custom reward.
DELETE /:rid Delete a custom reward.
POST /:rid/redeem/users/:uid Redeem a reward for a user

Wireframes

Drawings from design and planning process TBA.

Development Snapshots


Contact Us

Thank you for taking a look at Persistamp! :D
Please feel free to reach out and ask us anything.

David Lee (Full-stack developer, Open to work)
Resume PDF David Lee's email LinkedIn AngelList GitHub dyclee

Alicia Mira Kim (Full-stack developer, Open to work)
Resume PDF Alicia's email Blog Linkedin AngelList Portfolio GitHub alimirakim