Skip to content

Women-Coding-Community/wcc-backend

Repository files navigation

WCC: Platform Backend Service

How to start?

1. Start by making a Fork of wcc-backend repository. Click on Fork symbol in the top right corner.

2. Clone your new fork of the repository in the terminal/CLI on your computer with the following command:

git clone https://github.com/<your-github-username>/wcc-backend

Setup locally

JAVA 21 with SDKMAN

This project uses Java 21, you can run in 21.0.2 or 21.0.3. If you have installed a different version on your machine and don't want to remove it, you can use SDKMAN development tool.

  • Install SDKMAN

Open your terminal and run the following command:

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
  • Check the list of available Java versions:
sdk list java
  • Install the desired Java version
sdk install java 21.0.2-open 
  • Use the specific java version in the current session on your terminal
sdk use java 21.0.2-open

Set the default Java version for your system:

  • To set the newly installed Java version as the default:
sdk default java 21.0.2-open
  • To verify if the java version is correct use:
java -version

Setup IntelliJ

Lombok

Install lombok plugin and enable Annotation Processing, as the image below:

image

Enable Save Actions

image

Enable Checkstyle Warnings

Install checkstyle plugin and the configuration will be enabled

Google Format

A google-java-format IntelliJ plugin is available from the plugin repository. To install it, go to your IDE's settings and select the Plugins category. Click the Marketplace tab, search for the google-java-format plugin, and click the Install button.

The plugin will be disabled by default. To enable it in the current project, go to File→Settings...→google-java-format Settings (or IntelliJ IDEA→Preferences...→Other Settings→google-java-format Settings on macOS) and check the Enable google-java-format checkbox. (A notification will be presented when you first open a project offering to do this for you.)

To enable it by default in new projects, use File→Other Settings→Default Settings....

When enabled, it will replace the normal Reformat Code and Optimize Imports actions.

image

IntelliJ JRE Config

The google-java-format plugin uses some internal classes that aren't available without extra configuration. To use the plugin, go to Help→Edit Custom VM Options... and paste in these lines:

--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

Once you've done that, restart the IDE.

Before starting the IDE:

Install Docker Desktop if you do not already have it.

Check if Docker is installed

Run:

docker --version

Run Locally

Verify if Docker is running.

Note: Make sure you have docker daemon running locally to be able to run integration test, by execute

docker ps

  • Build containers
./gradlew clean bootJar
docker compose -f docker/docker-compose.yml up --build

Now you have the application running connected to the postgres database. Test the application via: http://localhost:8080/swagger-ui/index.html

  • Start the Application from your IDE

Stop the docker container of the application, springboot-app. Do not stop the container of the postgres. Start the application from your IDE.

  • Run tests
./gradlew test
  • Start the Spring Boot Application using Gradle:
./gradlew bootRun
  • Start Spring Boot Application via IntelliJ IDEA:

Open PlatformApplication.java right click and select Run or Debub.

  • Check if the application is running:
curl -X 'GET' \
'http://localhost:8080/api/cms/v1/footer' \
-H 'accept: */*' \
-H 'X-API-KEY: e8-Mm0ybormRil7k_DZO9jYtRAYW5VX5MCQiQG2CLD4'

Open API Documentation

Quality Checks

Deploy

About

Backend for Women Coding Community Platform Project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 14

Languages