Below is the C4 container diagram for the SecuRe system:
Note: This diagram illustrates the SecuRe system architecture, highlighting the interactions between its components:
- Single-Page Application (SPA): Built with JavaScript and React, it provides recommendation functionality via the user’s web browser.
- REST API Application: Developed with Java and Spring, it exposes recommendation functionality through REST endpoints.
- Database: A PostgreSQL database stores projects, security patterns, constraints and credentials.
- IAM (Keycloak): Handles authentication and provides secure access tokens.
- LLM (Language Model): Performs natural language processing.
- Web Server (NGINX): Delivers the SPA to users' browsers.
- Cache (Redis): Improves performance by caching API responses.
Follow the steps below to set up and run the SecuRe system:
Ensure you have the following installed on your system:
- Docker
- Docker Compose
- An OpenAI API Key (see instructions below)
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Configure the
.env
file:- Locate the
.env
file in the project root directory. If it doesn't exist, create a new file named.env
. - Add your OpenAI API key to the
.env
file in the following format:OPENAI_API_KEY=your_openai_api_key_here
- Locate the
- Visit the OpenAI Platform.
- Sign in or create an account if you don’t already have one.
- Navigate to the API Keys section under your account settings.
- Generate a new API key.
- Copy the API key and paste it into the
.env
file as shown above.
Important: Keep your API key secure and do not share it publicly.
You can use the provided run scripts to start the system easily:
Run the following script:
./run.sh
Run the following script:
.\run.ps1
Both scripts automatically configure the system to use the .env
file and start the application.
Alternatively, you can manually start the system using Docker Compose:
- Open a terminal in the project directory.
- Run the following command:
docker compose --env-file ./.env up --build
- Once the setup is complete, access the application at the URL specified in the terminal output (
http://localhost:5173
).