👨💻 Development Setup
Let's get started with SwiftWave Development Setup!
📦 Pre-requisites
- You need a linux system for development of SwiftWave.
- Install curl, git, unzip and tar utilities.
# For Debian/Ubuntu based distros:
sudo apt install curl git unzip tar make
# For Fedora based distros:
sudo dnf install curl git unzip tar make - Install docker (Skip this step if you already have docker installed)
curl -fsSL https://get.docker.com | sudo bash -
- Install Golang by following this guide
- Install NodeJS by following this guide
- You are all set! 🎉
📥 Local Installation
-
Fork and clone SwiftWave repository
git clone git@github.com:<your_username>/swiftwave.git --recursive
-
Build SwiftWave & Dashboard
make
-
Generate the SwiftWave configuration file
sudo ./swiftwave init
tipUse
localhost
as the domain name for management node. -
Enable development mode
sudo ./swiftwave config -e vim
Change
dev_mode
totrue
in the configuration file and save it. -
Start SwiftWave
sudo ./swiftwave start
warningUse a real email address in the setup process, else swiftwave may face failure to register account in Let's Encrypt.
-
🎉 Congratulations! You have successfully setup SwiftWave for local development
-
You can now access SwiftWave at
http://localhost:3333
Access GraphQL Playground
- Use Login Endpoint for generating a JWT Token.
You can also generate the token using curl command
curl --location 'http://localhost:3333/auth/login' \
--form 'username="admin"' \
--form 'password="admin"' - Go to
http://localhost:3333/playground
- In headers section, add authorization details
{
"Authorization": "Bearer <token_retrieved_from_api>"
} - Now, click on
refresh
icon on playground to get schema details and avail the auto-complete feature - You can now start querying and mutating data
- 🎉 Congratulations! You have successfully setup SwiftWave for local development