This repository contains both backend and frontend, although frontend was out of the scope of this project.
Clone the repository using
git clone https://github.com/itsHardStyl3r/the-swift-codes
Edit .env file in root with following content (you can keep the values as shown):
MYSQL_ROOT_PASSWORD=password
MYSQL_DATABASE=swifties
MYSQL_USER=user
MYSQL_PASSWORD=password
and then another .env in ./backend:
csvDataPath=the-swift-codes.csv
dbUser=user
dbPassword=password
dbAddr=mariadb_db:3306
dbDatabase=swifties
httpListenOn=0.0.0.0:8080
In the root directory of the project run this command
docker-compose up
and you should be good to go. The database will start and set up first, then the backend.
Backend is written in Go and uses mariadb. Frontend uses typescript and pnpm, so naturally you'd need node.js.
Follow detailed instructions on golang's website for all supported platforms.
- Windows (10 or newer)
Alternatively to the aforementioned instructions, you can install go using scoop.sh. To install scoop, in powershell run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
and then
scoop install go
and go should be installed and added to your path.
- Linux (apt package manager)
Update your package lists using
sudo apt update
and install golang-go with
apt install -y golang-go
and go should be installed on your system.
You can follow detailed instructions on nodejs.org webiste, especially for Linux.
- Windows
Again, you can use scoop.sh to install both. Head above to see its installation details and once complete, run
scoop install nodejs-lts pnpm
and you're done. Alternatively, use winget as explained here.
- Windows
Use scoop to install mariadb, run
scoop install mariadb
or follow instructions on mariadb website.
- Linux (apt package manager)
Run
sudo apt update
sudo apt install -y mariadb-server
and then
sudo mysql_secure_installation
to configure the database.
Clone the repository in a desired place using:
git clone https://github.com/itsHardStyl3r/the-swift-codes
Change directory to ./backend and run
go mod tidy
go mod verify
Change directory to ./frontend and run
pnpm install
go run cmd/main.go
pnpm run dev
See backend README.