- Table of Contents
- Motivation
- Product Summary
- Figma Design
- Technologies Used
- Setup Project
- NPM Workspaces
- WebHooks
- Postman Testing
- Contribution
Young adults between the ages of 18-21 face a sudden challenge when they first start interacting with money on their own especially when they start earning and spending independently. They are overwhelmed by the amount of advice, valid or not when it comes to interacting with their own money in the context of saving, budgeting, investing, insuring, and debts. Currently, they use experiential learning methods, which make them prone to making mistakes and learning from them. But such methods might shape their perspective about money incorrectly and inefficiently. By delivering optimized support through simulation and learning, Finlearn can help such personas and provide them with a platform to make those mistakes early on and realize better methods to manage money.
FinLearn is a financial literacy platform for young adults who are ready to take a step towards an independent lifestyle. FinLearn introduces young adults to concepts in personal finance and portfolio management through expert-curated lessons and a sandbox environment to test their learning. This is a zero-liability learning solution for learning to manage money without the risk of incurring a financial loss.
This project uses NPM Workspaces to manage
both the client
and server
dependencies, for more information read the section on
Install Packages. The client
folder contains the frontend built using
Next.js and React with Typescript. The server
folder contains the backend built using Node.js and
Express also with Typescript for the endpoints with database connection to MongoDB Atlas using Mongoose.
-
Clone the repo
git clone https://github.com/CSCC012023/final-project-s23-agile-avengers.git
-
If you are not using VS Code then follow these steps
npm install
-
If you are using VS Code then follow these steps
- Open the Command Palette using
Ctrl+Shift+P
orCmd+Shift+P
- Search for
Tasks: Run Task
and select it - Search for
Setup Project
and select it - VS Code will automatically install all the packages and close the shell.
- Open the Command Palette using
-
Create a
.env
file inside theserver
folder and copy the followingPORT=4000 MONGO_URI='Request Shashwat Piyush Doshi' ALPHAVANTAGE_API_KEY='Register for Alpha Vantage Stocks API'
-
Create a
.env
file inside theclient
folder and copy the followingNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY='Retrieve through Clerk Dashboard' CLERK_SECRET_KEY='Retrieve through Clerk Dashboard' NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
-
To get access to the database register for a MongoDB Account and send Shashwat Piyush Doshi your account email
-
To get access to the Alpha Vantage Stock API register here
-
(Optional) To use the
/webhooks
endpoints follow the instruction under Wehooks
-
If you are not using VS Code then follow these steps
-
Open a new Terminal and run the following command to start Client
npm run dev -w client
-
Open a new Terminal and run the following command to start Server
npm run dev -w server
-
-
If you are using VS Code then follow these steps
- Open the Command Palette using
Ctrl+Shift+P
orCmd+Shift+P
- Search for
Tasks: Run Task
and select it - Search for
Start Dev
and select it - VS Code will automatically Start the Client and Server and you can close them later.
- Open the Command Palette using
With NPM Workspaces,
you can install dependencies for multiple packages from the root package.json
.
To install dependencies for the client
and server
, run: npm install <package-name>
To install dependencies for client
, run: npm install <package-name> -w client
To install dependencies for server
, run: npm install <package-name> -w server
With NPM Workspaces,
you can run npm scripts for multiple packages from the root package.json
.
To run a command for the client
and server
, run: npm run <cmd> --workspaces
To run a command for client
, run: npm run <cmd> -w client
To run a command for server
, run: npm run <cmd> -w server
The Server makes use of Clerk Webhooks for managing new user creation, this is to help ensure that the user has a profile created in the database automatically when they sign up. This can be extended to other endpoints to track when a user delete their account or they started/ended a session on FinLearn.
For Windows, ensure that you have OpenSSH Client
A Webhook is essentially a POST request send from Clerk to our Server. For Clerk to send this request, it needs an actually URL it can access unlike localhost. We use a service called Serveo which exposes our local server to the internet for development. To use Clerk Webhooks, follow these steps below
-
Check if you already have a SSH key pair by running
ssh-keygen
-
If it asks you to overwrite, provide the response
n
and move to step 5 -
If it asks for a passphrase, provide a passphrase and continue
-
Once it generates the SSH key pair, it will print out your key fingerprint
-
To verify this run
ssh-keygen -l
to check the key fingerprint, below is an example of a fingerprint:SHA256:pmc7ZRv7ymCmghUwHoJWEm5ToSTd33ryeDeps5RnfRY
-
Run this command to start to SSH to Serveo.net:
npm run webhook -w server
-
If it is your first time it will ask for verification as such, use one of the methods to verify
> [email protected] webhook > ssh -o ServerAliveInterval=60 -R finlearn.serveo.net:80:localhost:4000 serveo.net To request a particular subdomain, you first need to register your SSH public key. To register, visit one the addresses below to login with your Google or GitHub account. After registering, you'll be able to request your subdomain the next time you connect to Serveo. Google: https://serveo.net/verify/google?fp=... GitHub: https://serveo.net/verify/github?fp=...
-
After verification, rerun
npm run webhook -w server
and you should see the following> [email protected] webhook > ssh -o ServerAliveInterval=60 -R finlearn.serveo.net:80:localhost:4000 serveo.net Forwarding HTTP traffic from https://finlearn.serveo.net
-
If you are not using VS Code then follow these steps
-
Open a new Terminal and run the following command to start Client
npm run webhook -w server
-
-
If you are using VS Code then follow these steps
- Open the Command Palette using
Ctrl+Shift+P
orCmd+Shift+P
- Search for
Tasks: Run Task
and select it - Search for
OpenSSH Server
and select it - VS Code will automatically Start the SSH and you can close them later.
- Open the Command Palette using
-
Do you use git flow?
Yes, we do follow Git Flow in this project.
-
What do you name your branches?
A branch should begin with a category, reference and description and will be this pattern
category/reference/description
.Category
We support 4 types of branches:feature
: Related to featuresbugfix
: Related to fixes for bugs indevelop
branchhotfix
: Relates to fixes for bugs inmain
and/orrelease/*
brancheschore
: Anything else
Reference
This portion should include a ticket number and must follow the format\FIN=#\
. If no ticket exists thennon-ref
can be used. -
Do you use GitHub issues or another ticketing website?
We use JIRA to track all issues that are referenced in PRs and in commits
-
Do you use pull requests?
Yes, we do use PRs and they must use the Pull Request Template
For more information about this check out the Team Contract under Version Control
Created by Team Agile Avengers