-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
279 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
MAIL_PASSWORD= | ||
MAIL_USERNAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Setup an action to run the frontend CI for PRs | ||
|
||
# name of the action | ||
name: Frontend CI | ||
|
||
# when should it run | ||
on: | ||
push: | ||
tags: | ||
- v** | ||
|
||
# what should it do | ||
jobs: | ||
# name of the job | ||
build: | ||
# what should it run on | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
# default values for all the steps | ||
defaults: | ||
run: | ||
working-directory: frontend | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run build | ||
run: npm run build | ||
- name: Run tests | ||
run: npm test | ||
- name: Run formatter + linter | ||
run: npm run check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ data | |
*.idea | ||
|
||
.DS_Store | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/com/greenfoxacademy/backend/config/FeatureFlags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.greenfoxacademy.backend.config; | ||
|
||
import lombok.Getter; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Configuration class for feature flags. | ||
*/ | ||
@Getter | ||
@Configuration | ||
public class FeatureFlags { | ||
|
||
/** | ||
* Flag to enable email verification. | ||
*/ | ||
@Value("${features.emailVerificationEnabled}") | ||
private boolean emailVerificationEnabled; | ||
} |
41 changes: 41 additions & 0 deletions
41
backend/src/main/java/com/greenfoxacademy/backend/config/RedisConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.greenfoxacademy.backend.config; | ||
|
||
import java.time.Duration; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.cache.CacheManager; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.redis.cache.RedisCacheConfiguration; | ||
import org.springframework.data.redis.cache.RedisCacheManager; | ||
import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
import org.springframework.data.redis.serializer.RedisSerializationContext; | ||
import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
|
||
/** | ||
* RedisConfig is a configuration class that defines the cache management strategy | ||
* for Redis in the Spring Boot application. It configures the Redis Cache Manager | ||
* and sets key serialization and expiration policies. | ||
*/ | ||
@Configuration | ||
@ConditionalOnProperty(name = "spring.cache.type", havingValue = "redis") | ||
public class RedisConfig { | ||
|
||
/** | ||
* The cacheManager method creates a RedisCacheManager bean that is used to manage. | ||
*/ | ||
@Bean | ||
public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { | ||
RedisCacheConfiguration cacheConfig = RedisCacheConfiguration.defaultCacheConfig() | ||
.entryTtl(Duration.ofMinutes(3)) // Set TTL to 5 minutes | ||
.disableCachingNullValues() | ||
.serializeKeysWith( | ||
RedisSerializationContext | ||
.SerializationPair | ||
.fromSerializer(new StringRedisSerializer()) | ||
); | ||
|
||
return RedisCacheManager.builder(redisConnectionFactory) | ||
.cacheDefaults(cacheConfig) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.