Create a .env file in the root directory of the project and add the following environment variables:
PORT=8080
JWT_SECRET='secretcode'
PROJECT_ID='c242-ps128-test-442602'
DATABASE_ID='capstone-bangkit'
ML_API_URL='https://financebro-ml-958019176719.us-central1.run.app/predict'
Fill the service account key file in the serviceKey.json file and firebase key file in the firebaseKey.json file.
Follow these steps to run the backend service using Yarn:
npm install -g yarn
yarn install
yarn build
yarn start
Follow these steps to run the backend service using Docker:
docker build -t backend-service .
docker run -p 8080:8080 backend-service
POST ~ http://localhost:8080/firebase
{
"email": "your-email"
}
DELETE ~ http://localhost:8080/firebase
- Header : Authorization Bearer
your-token
POST ~ http://localhost:8080/tracker
- Header : Authorization Bearer
your-token
{
"name" : "salman",
"age": 21,
"retireAge": 60,
"retirePeriod": 30,
"monthlyExpenses": 2000000
}
GET ~ http://localhost:8080/tracker
- Header : Authorization Bearer
your-token
UPDATE ~ http://localhost:8080/tracker
- Header : Authorization Bearer
your-token
{
"name" : "salman",
"age": 22,
"retireAge": 61,
"retirePeriod": 30,
"monthlyExpenses": 2000000
}
GET ~ http://localhost:8080/tracker/savings
- Header : Authorization Bearer
your-token
GET ~ http://localhost:8080/tracker/savingsname
- Header : Authorization Bearer
your-token
POST ~ http://localhost:8080/tracker/savings
- Header : Authorization Bearer
your-token
{
"name": "Saham2",
"amount": 2000000,
"type": "investment"
}
PUT ~ http://localhost:8080/tracker/savings
- Header : Authorization Bearer
your-token
{
"name": "Saham2",
"amount": 200000,
"type": "saving"
}
PUT ~ http://localhost:8080/tracker/savingsinvest
- Header : Authorization Bearer
your-token
{
"name": "Saham2",
"amount": 10000,
"type": "investment"
}
DELETE ~ http://localhost:8080/tracker/savings
- Header : Authorization Bearer
your-token
{
"name": "Saham2"
}
GET ~ http://localhost:8080/calculator
- Header : Authorization Bearer
your-token
POST ~ http://localhost:8080/predict
- Header : Authorization Bearer
your-token
{
"stock_code":"BBCA",
"start_date":"2024-12-11",
"end_date":"2024-12-15"
}