- Download Docker Desktop
- Run
docker compose up --watch
from the root directory to start the server, database, and interface. - To use the terminal for the server, run
docker exec -it server sh
. - Inside the server terminal, run
npx prisma studio
to view the database studio ornpx prisma db push --force-reset && npx prisma db seed src/sample.txt
to import the sample file.
To set up and run the project locally, follow these steps:
-
Ensure you have Node.js and npm installed on your system.
-
Clone the repository: 'git clone https://github.com/tlai18/tts-capstone.git'
-
Navigate to the root directory and install dependencies: 'npm install'
-
Start the server from the root directory: 'npm run start:server'
-
To start the client, navigate to the client folder: 'cd client &&npm run start'
-
Access and manage your database tables using Prisma Studio: 'npx prisma studio'
Firewall Configuration Processor This script, processConfig.ts, reads a firewall configuration file, parses each line to extract network objects and their attributes (like host, subnet, description), and inserts the parsed data into a MongoDB database using Prisma. It is built with TypeScript and Node.js, ensuring strong type safety and efficient data handling.
'npx ts-node src/server/processConfig.ts src/server/sample.txt'
To quickly reset and update the database with a new file:
-
Navigate to the root directory and install dependencies
-
Run 'npx prisma db push --force-reset && npx prisma db seed [filename]' with [filename] being the path to the file containing the new firewall rule configs.
To set up all the components:
- Start up a PostgreSQL database
- Create a
.env
in the root directory with DATABASE_URL=[DATABASE URL]. View Prisma documentation for more information on getting your database URL. - Run
npm install
to download dependencies for the backend server - Run
npx prisma studio
and navigate to http://localhost:5555 to view the current state of your database - Run
npm run start:server
to start the backend server - Navigate to frontend client directory with
cd client
- Run
npm install
to download dependencies for the frontend client - Run
npm run start
to start the client - Navigate to http://localhost:3000/proof to view the proof of concept page
To perform functions:
- Navigate to root directory first to begin importing data.
- Run
npx prisma db push --force-reset && npx prisma db seed [filename]
with [filename] being the path to the file containing the new firewall rule configs. A sample file is provided at the pathsrc/sample.txt
- In your web browser, navigate back to the proof of concept page at http://localhost:3000/proof
- Copy any host from your Prisma studio at http://localhost:5555 and paste it in the User form. Hit enter and your information should pop up shortly!