Skip to content

Latest commit

 

History

History
66 lines (37 loc) · 2.79 KB

get_started_dev.md

File metadata and controls

66 lines (37 loc) · 2.79 KB

Certify API Server - Get Started Guide [Dev]

The Certify project includes an API server that allows you to perform certain functions related to certification. This guide will walk you through the steps to set up and launch the API server on your local environment for development.

Prerequisites

Before you start, make sure you have the following prerequisites installed on your system:

  • Git
  • Docker
  • Docker Compose

I will also recommend installing a distro like debian on wsl2 for ease of use

Update ca-certificates in Debian

sudo apt-get update
sudo apt-get install --reinstall ca-certificates

Also Dont forget to add the user to docker group , dont run docker as sudo since it changes path for logs and other stuff https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

Clone the Repository

Begin by cloning the Certify repository to your local machine:

git clone https://github.com/your-username/Certify.git

Navigate to the api_server directory, where all the development-related files are located:

cd Certify/api_server

Launching the API Server

Before first launching the server , run the generate_ssl_keys.sh script with target username to generate self signed SSL Certificates to use . This is a one time thing .

  1. To ensure your changes to the api_server.py script are reflected, it's recommended to build the Docker image. Run the following command:

    docker-compose -f ./docker-compose-dev.yml up --build

    This command will rebuild the image and launch the API server. If you're not making any updates to the api_server.py script, you can omit the --build flag.

  2. The above command is optimized for WSL (Windows Subsystem for Linux) environments, as it allows easy interaction with mount volumes. You can use a Debian-based WSL distribution for this purpose ( thats what I use and works well) .

Cleaning Up Data

If you need to clean up the data generated by the database, follow these steps:

  1. Delete the volumes and directories manually:

    • Navigate to the home directory (~/) and find the certify folder, which contains the API server logs.
    • Also, find the mongodb folder, which contains the database data.

Exploring CLI Versions

The project also includes two CLI scripts for development purposes and to test out the final end user applications:

  • main.py: This script provides a CLI interface for interacting with the application (admin panel) .

  • validate.py: Another CLI script that allows you to validate the certificates .

Notes

the docker compose file and docker file should give you a good insight into how other stuff are inter related , so refer that if you feel confused about which port and where its all running

Feel free to modify this and contribute