-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Welcome to the NatterNet project! This guide will walk you through the steps required to get the project up and running on your local machine.
Before you start, make sure you have Docker and Docker Compose installed on your machine. If not, you can download them from Docker's official site.
-
Clone the Repository
git clone https://github.com/iammuho/NatterNet.git
-
Navigate to the Project Folder
cd NatterNet
To secure the API with JWT (JSON Web Tokens), you'll need to generate a pair of RSA keys. Below is the related code snippet:
-
Generate RSA Private Key
openssl genpkey -algorithm RSA -out private.pem
-
Generate RSA Public Key
openssl rsa -pubout -in private.pem -out public.pem
-
Environment Variables
Place these files in
/etc/ssl/certs
or update the environment variablesJWT_PUBLIC_KEY_PATH
andJWT_PRIVATE_KEY_PATH
to point to the appropriate file paths.JWT_PUBLIC_KEY_PATH=/path/to/public.pem JWT_PRIVATE_KEY_PATH=/path/to/private.pem
-
Run Docker Containers
This command will start the services defined in
docker-compose.yml
under the project namenatternet
.docker-compose -p natternet up -d
-
Start the NatterNet Application
cd cmd/app/ && go run .
At this point, your NatterNet application should be running, and you can access it in your browser at the specified address (e.g., http://localhost:8080).
-
Access MongoDB via Mongo-Express
You can access the Mongo-Express web interface at
http://localhost:8081
. -
Stop the Docker Services
When you are done with development, you can stop the Docker services with the following command:
docker-compose -p natternet down
Feel free to contribute and let us know if you have any questions or issues.