investbook

Problem Statement
Although people choose to invest in stocks indirectly under a retirement account such as an IRA or a 401k, according to the pew research center approximately 48% of U.S. Households do not hold any investments in the U.S. stock market and over 80% of households do not own individual stocks. Americans of modest incomes are significantly less invested in the stock market than wealthier Americans are.
With the advent of technology, access to information has never been easier. Like everything in life, investing is hard to understand until you try it and learn from your mistakes. Doing the same with real money may not be an option for majority of the people. Investbook allows you to build your portfolio with paper money and see how you perform over time.
"Buy a stock the way you would buy a house. Understand and like it such that you'd be content to own it in the absence of any market." - Warren Buffett
Investbook Links
Architecture
Investbook is developed using nextjs framework and tailwindcss . The backend is hosted on AWS and uses DynamoDB for database, AppSync for GraphQL APIs and Cognito for user management, authentication and authorization. The application also uses IEX Cloud for financial data. The application is deployed on Vercel.
Below is the high level architecture diagram.

Data Model
Here is the data model of the application.

Tools and Libraries Used
AWS Amplify was used to configure the application's backend. Amplify generates the needed GraphQL queries and mutations automatically. Below is an example of getting a portfolio by username using the GraphQL API
import { API } from 'aws-amplify';
import { getPortfolio } from "../graphql/queries";
const portfolio = await API.graphql({
query: getPortfolio,
variables: { id },
});
Deployment
Vercel for Github makes it really easy to deploy application from GitHub.
Demo
Comments
Join the discussionNice project! Couple of questions:
- Does creating the data model automatically provide a graphql API?
- How easy is it to customize the user auth (like adding attributes to the user model) in AWS cognito?
Would appreciate your feedback on my #vercelhashnode hackathon entry: https://pkj.hashnode.dev/list-and-share-your-favorites-with-favspage-vercelhashnode
Thanks Pankaj! Yes, Amplify generates the APIs (queries/mutations and subscriptions)
Yes, AWS Cognito allows to add up to 25 custom attributes.
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html
https://aws.amazon.com/blogs/mobile/aws-amplify-adds-support-for-custom-attributes-in-amazon-cognito-user-pools/
Hope that helps.
Congrats on your submission! I will take a look and get back.
Mahesh Rai Thank you for sharing the links. Hashnode announced their AWS Amplify hackathon at the right time :) I have a chance to try it out.
Yes. Good luck with the new hackathaon Pankaj!
Nice work.
What tool/software is that in the 'data model' screenshot?
Thanks Devion! I used Amplify Admin UI (https://docs.amplify.aws/console/adminui/intro)