/ideadog

A [statically-typed] social ideas platform ๐Ÿ•

Primary LanguageTypeScriptMIT LicenseMIT

NOTE 2-13-2021

I developed IdeaDog with a partner for our final project at Holberton School. This master branch features what my partner and I deployed for presentation at Holberton. What it doesn't feature is a revamp I worked on independently afterwards, in an effort to practice Next.js, Express and Redux. You can view this revamped work at this branch.

Please note that this app is no longer deployed.

-- Brennan


IdeaDog

A [statically-typed] social ideas platform.

IdeaDog logo

Description ๐Ÿ’ก

IdeaDog is a social media web application for sharing ideas.

We have all had those moments, those sudden bursts of inspiration where we think - "wow, that is simply a great idea" - but know we will never follow up. Now, instead of losing those ideas, share them with the world!

Why statically-typed?

Our kind of question.

The front-end of IdeaDog is built in React, with TypeScript, while the back-end runs on Rust. In our book, TypeScript + Rust = The Ultimate Statically-Typed Web App!

Medium Blog Posts ๐Ÿ“ฐ

For a more in-depth description of IdeaDog as well as an overview of its tech stack and development process, we have written a series of articles on Medium. You can read them at the links below:

Tech Stack ๐Ÿฉ

IdeaDog Tech Stack

Dependencies ๐Ÿ‘ซ

Front-End:

Tool/Library Version
TypeScript ^3.5.3
React ^16.8.6
Material UI ^4.2.1
Navi ^0.13.3
Auth0 JS ^9.11.2
@dwqs/react-virtual-list ^1.0.0
clipboard-copy ^3.0.0

View the complete list of front-end dependencies in the corresponding package.json.

Back-End:

Tool/Library Version
Rust 1.35
Actix 0.7
ArangoDB ^3.4

View the complete list of back-end dependencies in the corresponding Cargo.toml.

Packaging/Deployment:

Tool/Library Version
Node.js ^10.16.0
Yarn ^1.17.3
Parcel ^1.12.3
libssl-dev ^1.0

Front-End ๐Ÿ•

View the dedicated front-end README.md.

Back-End ๐Ÿพ

View the dedicated back-end README.md.

View the source code for the back-end Rust server at Martin's dedicated submodule.

Authentication ๐Ÿ”‘

Auth0 Logo

Passwords are no fun. IdeaDog features a passwordless user authentication process managed by Auth0. The process works as follows:

  1. User enters email (for login) or both email + username (for signup). Front-end initially sends email/username to back-end.

    1. If logging in, and an account does not exist with the given email, back-end returns a redirect code, and user is directed to sign-up.
    2. Otherwise, back-end generates and returns a challenge token associated with the email.
  2. Front-end temporarily stores challenge token in localStorage, then uses the Auth0 API to send a login email to the user. The login email includes a random code that user must enter to verify account.

  3. Upon entering the verfication code, the user is redirected to the home page of IdeaDog. The redirect occurs on a URL hashed by Auth0 which the front-end parses to retrieve the user's Auth0 profile.

  4. Front-end pulls up challenge token from localStorage and returns it to the back-end with the verified email. Back-end generates and returns a bearer token in the form of a cookie.

    1. After being returned to the back-end, the challenge token is cleared from localStorage.
  5. The bearer token has been set and the user can fully acccess their profile!

Authors โœ’๏ธ

License ๐Ÿ”’

This project is licensed under the MIT License - see the LICENSE file for details.