REST API for Expense Tracker Frontend app.
View Endpoints Docs.
-
Clone the repo
git clone https://github.com/Zeitverschwender/expense-tracker-backend cd expense-tracker-backend -
Duplicate
.env.examplefile and rename it to.envand fill in the required fields. -
Install requiremnets and start the server.
npm install npm start
To deploy the api to a live/production server. You can either use docker, docker-compose or K8s.
Duplicate .env.example file and rename it to .env and fill in the required fields or pass it through command line arguemnts when running docker run. Change the first part of the tag to your dockerhub id)
docker build -t digitalphoenixx/expense-tracker-api:latest .
docker run -p 8000:8000 digitalphoenixx/expense-tracker-api:latestReplace build tag and port used with appropriate values.
Duplicate the .env file and fill in the data. Replace the port number in the docker-compose.yml file with preferred port. Then run
docker-compose up-
Build the image. (change the first part of the tag to your dockerhub id)
docker build -t digitalphoenixx/expense-tracker-api:latest . -
Change the image name in the
.k8s/kustomization.ymlto the tag used in the build step. -
Fill in
FRONTEND_URLin.k8s/config.yml. -
Change the hostname in the
.k8s/ingress.ymlto your domain. -
Create deployment.
kubectl apply -k .k8s/
-
Create the secret with the mongo connection string.
kubectl create secret generic expense-tracker-api-secret -n expense-tracker --from-literal=DB_CONNECTION="VALUE_HERE" --from-literal=GOOGLE_CLIENT_ID="VALUE_HERE" --from-literal=GOOGLE_CLIENT_SECRET="VALUE_HERE" --from-literal=JWT_SECRET="VALUE_HERE"
-
Check the everything is running, might take a second. Note: Ready is 1/1.
> kubectl get -n expense-tracker all NAME READY STATUS RESTARTS AGE pod/expense-tracker-api-deployment-69f94b7657-584xf 1/1 Running 0 24s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/expense-tracker-api-service ClusterIP 10.101.156.245 <none> 8000/TCP 24s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/expense-tracker-api-deployment 1/1 1 1 24s NAME DESIRED CURRENT READY AGE replicaset.apps/expense-tracker-api-deployment-69f94b7657 1 1 1 24s
- VS Code - Code Editor
- Docker Desktop - Containerization
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Sameh Amnoun - Main Dev - SamehAmnoun
- Mohamed Walid - Main Dev - m-walid
- Mohamed Said Sallam - Main Dev - TheDigitalPhoenixX
See also the list of contributors who participated in this project and their work in CONTRIBUTORS.md.
This project is licensed under the MIT License - see the LICENSE file for details