Made using Spring and Java17, this project was made as the backend of the hideyoshi.com project, as so it is mainly responsible for user authentication and user sessions.
All code in this repo is distributed freely by the GPLv3 License.
For the execution of this project the following environment variables must be set:
FRONTEND_PATH
: for allowed origins
TOKEN_SECRET
ACCESS_TOKEN_DURATION
REFRESH_TOKEN_DURATION
-
Default User Configuration:
DEFAULT_USER_FULLNAME
DEFAULT_USER_EMAIL
DEFAULT_USER_USERNAME
DEFAULT_USER_PASSWORD
-
Storage Service MicroService:
STORAGE_SERVICE_PATH
-
OAuth2 Configuration:
-
Google:
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GOOGLE_REDIRECT_URL
-
Github:
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
GITHUB_REDIRECT_URL
-
-
Database:
DATABASE_URL
DATABASE_USERNAME
DATABASE_PASSWORD
-
Redis:
REDIS_URL
REDIS_PORT
REDIS_PASSWORD
Building project:
./mvnw -Dmaven.test.skip -f pom.xml clean package
Executing project:
java -jar target/backend-*.jar
GET /user
POST /user/signup
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Fullname |
email |
string |
Required. Email |
username |
string |
Required. Username |
password |
string |
Required. Password |
POST /user/login
Parameter | Type | Description |
---|---|---|
username |
string |
Required. |
password |
string |
Required. |
POST /user/login/refresh
Parameter | Type | Description |
---|---|---|
refreshToken |
string |
Required. |
DELETE /user/delete
DELETE /user/delete/:id
POST /user/profile-picture
Parameter | Type | Description |
---|---|---|
fileType |
string |
Required. |
DELETE /user/profile-picture
POST /user/profile-picture/proccess
{
"id": int,
"name": string,
"email": string,
"username": string,
"roles": string[],
"provider": string,
"accessToken": {
"token": string,
"expirationDate": datetime
},
"refreshToken": {
"token": string,
"expirationDate": datetime
}
}