You can see all api feature at our API documentation
To run this project, you will need the following credential file:
- Firebase Admin SDK
Go to firebase console -> pick your project -> project setting -> service account tab -> genereate new private key - Firebase Config/Client
Go to firebase console -> pick your project -> project setting -> in general tab scroll down -> click add app button -> pick web logo "<\>" -> fill app nickname & click register app -> copy all const firebaseConfig variabel value -> make a new json file -> paste value from firebaseConfig variabel before and save the json file - Cloud Storage Credential
Go to google cloud console -> go to IAM & Admin tab -> service account -> create service account -> fill service account name (ex: cloud-storage-barkit-admin) -> select the role to cloud storage admin -> click done -> click your service account you already created -> go to KEYS tab -> click add key -> create new key -> pick json -> create
Note: Note: if you are someone i know, request & download our credential Here
- Install node.js version 18.16.0 here
Make sure your node.js and npm already install in your device using, open cmd and run:Note: In development we are usingnode -v npm -v
Windows 10 Pro
,Visual Studio Code
,node version 18.16.0
, andnpm version 9.5.1
. - Credential File
- Docker, if you want to run this repostory with docker (recommended) and deploy to cloud run
- Google Cloud Platform Account & Cloud Storage Bucket
Follow this step to run this repostory code in your local device:
- Open git bash and Clone the repo
git clone https://github.com/BangkitCapstone2023/BarKit-CC.git
- Go to project folder
cd BarKit-CC
- Open the project at VS Code
code .
- open terminal & install Package
npm install
- Make sure you already have the Credential File and store the credential file name in
app/config/config-template.json
file. - And also Change
projectID, bucketName, and databaseURL
value atapp/config/config-template.json
file, with your GCP project id, bucket name, and firestore database url, see the example here - Change
config-template.json
file name toconfig.json
- Start the server
npm start, or npm run dev (using nodemon)
Note:
- Steps 5-7 are only performed if you do not have access to Our Credential. If you are someone we know, please request to obtain our credentials and config file. After you download our credential make sure to store it at app/config folder.
- If there are any errors with
tfjs-node
, try this step
Using Docker so you dont need to configure node version
or get any error with tfjs-node
- Open git bash and Clone the repo
git clone https://github.com/BangkitCapstone2023/BarKit-CC.git
- Go to project folder
cd BarKit-CC
- Open the project at VS Code
code .
- Make sure you already have the Credential File and store the credential file name in
app/config/config-template.json
file. - And also Change
projectID, bucketName, and databaseURL
value atapp/config/config-template.json
file, with your GCP project id, bucket name, and firestore database url, see the example here - Change
config-template.json
file name toconfig.json
- open terminal & build docker image
docker build -t barkit-backend .
- Run the docker image
docker run -p 8080:8080 barkit-backend
Note:
- Steps 4-6 are only performed if you do not have access to Our Credential. If you are someone we know, please request to obtain our credentials and config file. After you download our credential make sure to store it at app/config folder.
- You can use another name & add tag for the image
You can ask us about your error here ,but If you have a problem with tensforflow.js
when run locally with NPM, here some tips:
npm install -g node-gyp
Install the current version of Python
here or from the Microsoft Store package in our development we are suing python 3.9.6.Install Visual C++ Build Environment
: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio Community (using the "Desktop development with C++" workload)- Go to powershell -> Run as administrator ->
npm install -g --production windows-build-tools
Note: For TFJS-Node Error
- If you already done with 1 step (ex: install node-gcp), try running the server again. If the error persists, move on to the next step.
- If there is any error with node-gyp, try going here.
- If there is any error when trying steps 3 (install Python & Visual C++ build tools), check here.
- If there is any error with step 4 (install windows-build-tools), check here.
To deploy this project we are using cloud run at GCP (you can use another service), this is the way to deploy it at cloud run:
- Build Container Image
docker build -t IMAGE-NAME .
- Run the docker image for make sure everything okay
docker run -p 8080:8080 IMAGE-NAME
- Make a repostory at artifact registery
- Push the Docker image to a artifact registery
docker tag SOURCE-IMAGE LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG
docker push YOUR-TAGGED-IMAGE-NAME
- Create a cloud run service and use your image at artifac registery repostory
- Check your deployed API Link
Note:
- Replace IMAGE-NAME, PROJECT-ID, REPOSTORY, TAG, YOUR-TAGGED-IMAGE-NAME according to what you have/want
- You can also use our cloudbuild.yaml file to CI/CD using cloud build at GCP, but dont forget to replace some variabel there
After you running the server you can testing it at postman, you can see our API Documentation for more detail
Contributions are always welcome! See CONTRIBUTING.md for ways to get started.
Muhammad Thoriq Ali Said - LinkedIn - Github - Instagram
Bellow is useful resource that we used in our project