ECIBot server is a custom API for ecibot.wokis.es.
- Java 17.
- Other requisites are already built in on
build.gradle.kts
. (See more here) - Knowledge using a terminal.
- A little bit of time.
- Optional: Coffee to drink while executing the app.
- After checking pre-requisites and having all dependencies installed, you can just go to
Application.kt
and runfun main()
. - Also, you can generate a
fat-jar
by executingfatJar
task onbuild.gradle.kts
. After that, you may execute the app by double clicking it or by executing it on a terminal usingjava -jar base-ktor-server.jar
. - Lastly, you can download last version of the project, check it out on here.
BKS is a base project made to be used on other projects for Wokis network. It has already user related routing and ready to use.
You may configure some stuff on app.conf
file. You can check it out here.
Routes are rate limited. They can be used up to 100 times by default, but they may be modified to change this limitation.
GET /user/{id}/avatar
: get user's avatar, if it exists.
GET /users
: fetch all users on the database. It may be deleted on other project.GET /user
: fetch current user's info. It identifies the user by using JWT token. It will only fetch its own info.PUT /user
: updates current user. It identifies the user by using JWT token. It will only modify its own info.POST /user/image
: uploads new image for the authenticated user. It will be saved on the folder configured onapp.conf
.DELETE /user/image
: removes user's image.POST: /2fa
: activates 2fa authentication on this account. It will be used to confirm actions. 2fa will be asked whenever the route haswithAuthenticator(user)
wrapper.DELETE /2fa
: removes 2fa authentication on this account. It will ask 2fa code.
It is rate limited using a custom rate limit. This routes can be used up to 10 times a minute.
POST /login
: logs in the user. It can use username or email to authenticate.POST /register
: registers the user. It will be asked username, email and password.GET /verify/{token}
: It's used to verify user's email. It may be skipped, but is recommended to verify user's email.POST /recover
: Used to generate recover email to recover user's password.POST /recover-pass
: It will be used to recover user's password.
POST /verify
: resends verification email.POST /change-pass
: changes user's password. It need old password and new password.POST /logout
: removes user token.DELETE /sessions
: removes all user tokens.
TODO:
Any suggestion? Create a ticket here.
- Have you found one? Create a ticket here.