- .net6 SDK
- Docker
- node.js (recommended version 16+)
- Clone project (of course)
Done!
- Start redis by
cd src
thendocker-compose up -d redis
- Open
src/GitLabKit.sln
with .net IDE of choice. - Provide GitLab token to the app by add file in project
GitLabKit.Runner.Web
calledappsettings.Secrets.json
with content.
{
"Connections": {
"GitLabServer": "https://<your-gitlab-server>"
},
"Secrets": {
"GitLabToken": "<your-gitlab-token>"
}
}
This file will be ignored by git.
Make sure you have sufficient permission to get CI/CD settings for your group.
Fail to provide valid API key will make API not able to fetch data from GitLab.
(you can also store other settings you don't want to include in git too!, see appsettings.json
for complete configs)
Then, there's a launch setting called Dev
for project GitLabKit.Runner.Web
.
Start it and API will be served on port 8888
- Open
src/clientside
with JavaScript editor of choice - Run
yarn
to install dependencies - Run
yarn start
to start the dev website on port3000
Then the clientside will forward API requests to localhost:8888
automatically
In case if you need to not connect to GitLab.
You can run mock server by start the launch setting Mock
for project GitLabKit.Runner.Mock
.
Mock will be served on port 9999
by default, you can change this in launchSettings
if needed.
Don't forget to change gitlab server settings in web project to call the mock.
As an alteranative to setup above, you can also run the project using predefined docker-compose.yml
file. Update settings in env
and just docker-compose up
.
This will build production-like image and stand everything up incluing mock.
This project use .net env config provider.
So everything you see in appsettings can be passed from env.
But it requires double underscores for setting properties in objects.
For example { foo: { bar: "value" } }
becomes FOO__BAR=value
.
Read the doc to learn more.
- Client code that fetch data from server side is generated using
openapi-generator
. - Server is serving openapi/swagger specs generated from controllers code using
swashbuckle
- So you have to make changes to controllers first.
- Then start the server
- And finally, in
src/clientside
runyarn gen-client
and you'll see code changes insrc/clientside/src/api-client
(DO NOT MAKE ANY CHANGES MANUALLY IN THIS FOLDER!) - Then, you can use new/modified endpoints/models in client side code
- Don't forget to include generated change in commit
TODO