Content Crafters is a microservice that manages metadata for programs and user data. It also handles information about content imports, edits, and shares. The service stores data related to likes, comments, and social interactions related to content. Additionally, it manages versioning information and collaborative changes to programs.
git clone https://github.com/jabibamman/content_crafters.gitcd content_crafterscargo buildcargo runThe application will start at http://localhost:8080.
If you want to run the application with different port, you can set the APP_PORT environment variable.
APP_PORT=3000 cargo runThe application provides a Kubernetes deployment file in the k8s directory. You can deploy the application using the following command:
./deploy_k8s.shThe script will create a namespace, deployment, and service for the application.
We use a secret service to store the environment variables. You can create the secret using the following command:
kubectl apply -f secret.yamlIf you want to add more environment variables, you can add them to the secret.yaml file.
WARNING: The environment variables are base64 encoded. You can encode your environment variables using the following command:
echo -n "your-environment-variable" | base64The application also provides a CLI to interact with the service. You can run the CLI using the following command:
cargo run -- --helpdocker build -t content_crafters .docker run -d -p 3000:3000 -e APP_PORT=3000 content_craftersIf you want to run the container with logs, you can add the
-e VERBOSE=1
OR
-e DEBUG=1
OR
-e TRACE=1
flag to the docker run command.
You can also use Docker Compose to run the application. The docker-compose.yml file is already provided in the repository. You can run the application using the following command:
docker-compose up --build> gcloud compute instances list --filter="name~'gke-'" --format="table(name, networkInterfaces[0].accessConfigs[0].natIP)"