0% found this document useful (0 votes)
45 views8 pages

Portfolio Tracker

The document outlines the setup and deployment instructions for a Portfolio Tracker application using a tech stack that includes Vite, React, Spring Boot, and PostgreSQL. It provides detailed steps for running the project locally, including cloning the project, setting up the frontend and backend, and initializing the database schema. Additionally, it includes troubleshooting tips for common issues encountered during setup.

Uploaded by

anglelathow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views8 pages

Portfolio Tracker

The document outlines the setup and deployment instructions for a Portfolio Tracker application using a tech stack that includes Vite, React, Spring Boot, and PostgreSQL. It provides detailed steps for running the project locally, including cloning the project, setting up the frontend and backend, and initializing the database schema. Additionally, it includes troubleshooting tips for common issues encountered during setup.

Uploaded by

anglelathow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Portfolio Tracker [Website Link]

Tech Stack Used :

Frontend: Vite, React, Tailwind CSS,


Backend: Spring Boot,
Database: PostgreSQL,
APIs Used: Finn Hub, Alpha Vantage
Docker
GitHub

Deployments:

• Frontend : Render,
• Backend : Railway,
• Database : Railway.

Steps to Run the Project Locally :


Option 1 : Clone the Project from GitHub
o Frontend [Link]
o Backend [Link]
o Database [Schema provided below]
Option 2 : Use the Docker Image
Docker Pull Command :
o Frontend [docker pull nithyanandb/production-frontend]
o Backend [docker pull nithyanandb/production-backend]
o Database [Schema provided below]

1. First Setup the Database Table in PostgreSQL or MySQL

Users Table :
CREATE TABLE users (
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
id BIGSERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
provider VARCHAR(255) NOT NULL,
provider VARCHAR(255) NOT NULL,
roles VARCHAR(255) NOT NULL
roles VARCHAR(255) NOT NULL
);
CREATE TABLETable
Users Roles user_roles
: (
user_id BIGINT NOT NULL,
CREATE TABLE user_roles (
roles VARCHAR(255) NOT NULL,
user_id BIGINT NOT NULL,
PRIMARY KEY (user_id, roles),
roles VARCHAR(255) NOT NULL,
FOREIGN KEY (user_id) REFERENCES us
PRIMARY KEY (user_id, roles),
);
FOREIGN KEY (user_id) REFERENCES users(id)

);

CREATE TABLE login_activity (


Login Activity Table :
id BIGSERIAL PRIMARY KEY,
CREATE TABLE
date DATE NOTlogin_activity
NULL, (

id BIGSERIAL
count PRIMARY KEY,
INT NOT NULL,
user_id BIGINT
date DATE NOTNOT NULL,
NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
count INT NOT NULL,

user_id BIGINT NOT NULL,

FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE

);
Portfolios Table :
Portfolios Table :
CREATE TABLE portfolios (
CREATE TABLE portfolios (
id BIGSERIAL PRIMARY KEY,
id BIGSERIAL
user_id BIGINT PRIMARY KEY,
NOT NULL,
user_idVARCHAR(255)
symbol BIGINT NOT NULL,
NOT NULL,
name VARCHAR(255),
symbol VARCHAR(255) NOT NULL,
quantity INT NOT NULL,
name VARCHAR(255),
average_price DOUBLE PRECISION NOT NULL,
quantity INT NOT NULL,
current_price DOUBLE PRECISION NOT NULL,
average_price DOUBLE PRECISION NOT NULL,
day_change_percent DOUBLE PRECISION NOT NULL,
current_price DOUBLE PRECISION NOT NULL,
high_price DOUBLE PRECISION NOT NULL,
day_change_percent
low_price DOUBLENOT
DOUBLE PRECISION PRECISION
NULL, NOT NULL,
open_price
high_priceDOUBLE
DOUBLE PRECISION
PRECISION NOT
NOT NULL,
NULL,
previous_close DOUBLE
low_price DOUBLE PRECISION
PRECISION NOTNOT NULL,
NULL,
total_value DOUBLE PRECISION NOT NULL,
open_price DOUBLE PRECISION NOT NULL,
purchase_date TIMESTAMPTZ NOT NULL,
previous_close DOUBLE PRECISION NOT NULL,
last_updated TIMESTAMPTZ NOT NULL,
total_value DOUBLE PRECISION NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
); purchase_date TIMESTAMPTZ NOT NULL,
last_updated TIMESTAMPTZ NOT NULL,

FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE

);
Transactions Table :
Transactions Table :
CREATE TABLE transactions (
CREATE TABLE transactions (
id BIGSERIAL PRIMARY KEY,
id BIGSERIAL
user_id BIGINT PRIMARY KEY,
NOT NULL,
symbol
user_idVARCHAR(255) NOT NULL,
BIGINT NOT NULL,
type VARCHAR(50)
symbol NOT NULL,
VARCHAR(255) NOT NULL,
quantity INT NOT NULL,
type VARCHAR(50) NOT NULL,
price DOUBLE PRECISION NOT NULL,
quantity INT NOT NULL,
total_amount DOUBLE PRECISION NOT NULL,
price VARCHAR(255)
status DOUBLE PRECISION NOT NULL,
NOT NULL,
date TIMESTAMPTZ
total_amount NOT NULL,
DOUBLE PRECISION NOT NULL,
FOREIGN KEY (user_id) REFERENCES
status VARCHAR(255) NOT NULL, users(id) ON DELETE CASCADE
);
date TIMESTAMPTZ NOT NULL,

FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE

);
Prerequisites :
• Node.js (v18 or higher)
• npm (package manager)
• Java JDK (v17 or higher for Spring Boot)
• PostgreSQL (v15 or higher) – pgAdmin 4
• IDEs:
o VS Code (frontend)
o IntelliJ IDEA (backend)

Step 1: Clone the Project


• Frontend [Link]
• Backend [Link]

Step 2: Set Up the Frontend

Open VS Code

• Open Project Folder which is already in project directory


• Using PowerShell Run this Commands
• npm install # Install dependencies
• npm run dev # Start the development server

Access the frontend at: http://localhost:3000


Step 3: Set Up the Backend

Open IntelliJ IDEA

1. Navigate to the backend directory:

2. Configure the application.properties file with your database


credentials:

3. spring.datasource.url=jdbc:postgresql://localhost:5432/capxdb

4. spring.datasource.username=root

5. spring.datasource.password=qwerty

6. Run the Spring Boot application:

o Using directly through Run Button or

o Using Maven Wrapper: ./mvnw spring-boot:run

7. backend will run on the port: http://localhost:2000/

Note : Make sure that all dependencies in pom file and package. json
are installed properly
Step 4: Set Up the Database
1. Open your PostgreSQL client or pgAdmin 4 and create a new database:
2. CREATE DATABASE capxdb;
3. Execute SQL scripts to initialize the database schema (provided in the
"Database Tables" section).

Step 5: Run the Project


Ensure both the frontend and backend are running simultaneously.
Access the application in your browser at http://localhost:3000.

6. Troubleshooting
• Frontend not running:
Ensure all dependencies are installed by running npm install in the
frontend directory.
• For Command line interface Use : PowerShell
• Backend not connecting to the database:
Verify the credentials in the application.properties file.
• Port conflicts:
Change the ports in vite.config.ts (frontend) or application.properties
(backend).

+91 9080970408
[email protected]

You might also like