Hi im a bit new on go and i would like implement a...
# talk-kratos
s
Hi im a bit new on go and i would like implement an simpple go app with self hosting kratos. just for learn and purpose (of learning go and auth), then i would like implement the others component. i've been reading the documentation but im a bit overwhelmed. So i would like to ask if you guys can give me some advice to achive the first step. implement a simple go app with kratos. what i should consider?
s
Start by thinking about your API first (after all this is your business logic, the most critical bits of your code). Design the routes, what resources you will have, what functionality etc. Then think about which routes require authentication (i.e. for which routes you need to call Kratos). It will probably be best to implement this as a middleware that you attach only to routes that require auth
Also think about how your app will be used. Is it just an API for your clients to consume or you will have a frontend that consumes it too (e.g. a browser app). You need to think about this to determine whether you will use cookies or tokens when authenticating with Kratos
For local setup, I prefer docker-compose. Kratos already has good quickstart documentation on starting it in a docker setup
s
thanks, this will help me alot