---
title: Dependency Tree
---
flowchart LR
cmd
subgraph internal
server_go[/server.go\]
app
controllers
models
views
controllers --> server_go
views --> controllers
app --> controllers
app --> server_go
models --> controllers
models --> app
models --> views
end
subgraph pkg
imgbb
tsp
end
server_go --> cmd
app --> cmd
pkg --> internal
These extensions will popup as advised extensions
- Press
ctrl
+p
(MacOS:command
+p
) - Paste
>Go: Install/Update Tools
into text input - Select all options
- click OK
make docker-start
Copy /server/config.example.yml
to /server/config.dev.yml
Some values are obfuscated how to add these are explained below
This is required for payment calls, if you are not working on those calls these steps are not needed
- Create a stripe account
- Download and install the stripe cli https://stripe.com/docs/stripe-cli
- From https://dashboard.stripe.com/test/apikeys
- Copy secret key to
stripe_secret_key
in/server/config.yml
- Copy publishable key to
VITE_STRIPE_PUBLIC_KEY
in/frontend/.env
- Copy secret key to
- Go to webhooks and click Add an endpoint
- Set Endpoint url
http://localhost:8080/v1/payment/webhook
- Click add endpoint
- Set Endpoint url
You must do this for the server to run properly.
Copy the value of MYSQL_PASSWORD
found in /server/docker/docker-compose.yml
, use the password to fill in db_pass
in /server/config.dev.yml
Copy /server/config.dev.yml
to /server/config.test.yml
This enables tests to use the same database.
make start
If you want you can create some fake data to use in your development environment. To do so run this command:
make generate-fake-data
Then setup some default users, a user for each permission role. Run the following in your database client of choice:
To document, test and use the server independently, Postman is to be used.
Install one of the Postman Rest client options here:
- app: https://www.postman.com/downloads/
- browser agent: https://www.postman.com/downloads/postman-agent/
- cli: https://learning.postman.com/docs/postman-cli/postman-cli-installation/
Here is the link to the postman collection: https://www.postman.com/the-clothing-loop/workspace/the-clothing-loop/overview
Be warned that everything saved is publicly available if you want to save, remove the sensitive data beforehand or use an environment variable
make start
make build-server
This is an attempt to use shared hosting, but has never been properly tested.
make build-server-fcgi
make test
This is to create a test environment It includes handy environments to test:
- database queries
- email smtp test server (TODO)
make docker-start
And to stop the docker containers
make docker-stop
Although the golang.go
vscode extension should lint your code for you, there is also a command as well:
make lint
Variable | Type | Example | Description |
---|---|---|---|
base | default | http://localhost:8084 | Base server url |
token | secret | ********************* | Login, in a browser and find the token cookie |
userUID | default | e896d087-5dd0-44fa-a549-2ead33a63d7a | User UID |
chainUID | default | 48ca9112-912a-43b4-a8bc-16dcd79f383d | Chain UID |
- Here's how to find cookies from the website: Chromium: https://superuser.com/a/1114501 Firefox: https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/index.html
- Select the cookie named
token
and copy its value - Paste the value into Postman
- Make sure that the
userUID
is from the account you logged in with - If you want to send api requests that have a higher authentication level;
- AuthState3AdminChainUser & AuthState2UserOfChain: you need to set the
chainUID
to a loop that will relate to the user (seeuser_chains
table) and if need be, haveuser_chains.is_chain_admin
set to True. - AuthState4RootUser: you need to set the
users.is_root_admin
database cell to True.
- AuthState3AdminChainUser & AuthState2UserOfChain: you need to set the