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.
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
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
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 .
-
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. -
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) .
If you need to clean up the data generated by the database, follow these steps:
-
Delete the volumes and directories manually:
- Navigate to the home directory (
~/
) and find thecertify
folder, which contains the API server logs. - Also, find the
mongodb
folder, which contains the database data.
- Navigate to the home directory (
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 .
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