Skip to content

keepid/keepid_server

keepid_server

Build Statuscodecov Codacy Badge Uptime Robot ratio (30 days) Uptime Robot status GitHub issues Mozilla HTTP Observatory Grade GitHub code size in bytes Snyk Vulnerabilities for GitHub Repo

Keep.id Server Application. Built with Java and Kotlin, this application serves to empower organizations fighting homelessness with tools to help with document storage and other aid.

https://docs.google.com/document/d/1gmrSSzV4gzMEUXjU6bq57TjtAl6zrw1i61FxxzykK94/edit?usp=sharing

Docker Setup (Recommended)

This is the easiest way to get started. It works on any device (Mac, Windows, Linux) and does NOT require you to install Java, Maven, or MongoDB on your machine.

Prerequisites:

How to run:

  1. Ask a team member for an .env file to copy into the root directory (same level as this README). This file contains things like db connections and encryption keys so don't share them.

  2. Run the application:

    docker-compose up --build

    This will start both the Java Server and the MongoDB database. You have to rerun with --build everytime you make a change.

  3. The server is ready when you see "Javalin has started" in the logs.

    Access the server at http://localhost:7001. The app exposes port 5005 for remote debugging.

  4. mvn test won't work out of the box since it relies on loading in .env variables into the terminal. IntelliJ handled that with the EnvFile plugin. If you have Node, you can use npx env-cmd -f .env -- mvn verify or npx env-cmd -f .env -- mvn test -Dtest={test class}


Legacy Manual Setup

How to get the backend service running locally (without Docker):

  1. make sure you have Java in the JAVA_HOME environment variable
  2. make sure you have maven (run "mvn --version" in terminal to check)
  3. make sure you have Java 21 JDK/JRE installed. If you wish to have multiple Java versions, look into Java Jabba, which is a Java Version Manager.
  4. make sure you install IntelliJ, and install these extensions under File -> Settings -> Plugins:
    • google-java-format (this will help enforce Java code style)
    • Save Actions (this will automatically enforce Java code style on save)
  5. make sure that in IntelliJ, maven auto-import is turned on (there will be a pop up usually, or just search up online on how to enable this). You may have to restart IntelliJ multiple times for it to show up
  6. under File -> Settings -> Other Settings -> Save Actions, check the first two boxes under General and the first two boxes under Formatting Actions. This will enforce the code style on save
  7. under File -> Project Structure -> Modules, set Project SDK and Project Language Level to 21. Additionally, YOU MUST SET YOUR SOURCES, TESTS, TEST RESOURCES, AND EXCLUDED FOLDERS. This step is VERY IMPORTANT, or else nothing will run. Set Source Folders as src/main, Test Source Folders as src/test, Test Resource Folders as src/test/resources, and Excluded Folders as target. Make sure Language level is set to 21. Under the Dependencies tab, make sure the Project SDK is set to 21.
  8. you can run tests or run App
  9. check logs in logs/app.log
  10. ALSO if you are having a Null Pointer CustomException in the Mongo Config, please follow the instructions here: https://github.com/Ashald/EnvFile. We are deprecating the use of dotenv because it is interfering with our heroku deployment (also the heroku deployment doesn't see the env file anyway). Therefore, please edit the run configurations in IntelliJ at this link here: https://github.com/Ashald/EnvFile.

About

Keep.id server application. Built with Java.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors