Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/maven/org.apache.maven.plugins-ma…
Browse files Browse the repository at this point in the history
…ven-war-plugin-3.3.2
  • Loading branch information
jo-elimu authored Jul 2, 2024
2 parents 68d22a1 + 6412eea commit 331b94f
Show file tree
Hide file tree
Showing 456 changed files with 18,379 additions and 10,133 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

custom: ['http://eng.elimu.ai/contributions/donate']
custom: ['https://www.drips.network/app/drip-lists/41305178594442616889778610143373288091511468151140966646158126636698']
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: 🐛 Bug report
about: Create a report to help us improve
title: ''
labels: ''
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Feature request
name: 📲 Feature request
about: Suggest an idea for this project
title: ''
labels: ''
Expand Down
4 changes: 4 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage:
range: 13..80
round: down
precision: 2
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
open-pull-requests-limit: 2

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 2
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Maven CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java: [11, 17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: maven
- run: mvn clean
- run: mvn compile
- run: mvn package -P Jspc
- run: mvn test
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
target/
.idea/
.vscode/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
Expand Down
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
See https://github.com/elimu-ai/wiki/blob/master/CONTRIBUTING.md#workflow-example-webapp
# Contributing

## Contributing to elimu.ai 👩🏽‍💻

See https://github.com/elimu-ai/wiki/blob/main/CONTRIBUTING.md

## Funding Splits 💦

> [!NOTE]
> The maintainer splits at https://www.drips.network/app/projects/github/elimu-ai/webapp should reflect the data in [`FUNDING_SPLITS.csv`](FUNDING_SPLITS.csv). If your GitHub username is in `FUNDING_SPLITS.csv`, add your Ethereum address next to it.
34 changes: 29 additions & 5 deletions DB_MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# DB Migration 🔀

By using the Java Persistence API (JPA), classed annotated by @Entity (in the [`model`](src/main/java/ai/elimu/model) package) get mapped automatically to database tables/columns: [`src/main/resources/META-INF/jpa-persistence.xml`](https://github.com/elimu-ai/webapp/blob/master/src/main/resources/META-INF/jpa-persistence.xml)
By using the Java Persistence API (JPA), classed annotated by @Entity (in the [`model`](src/main/java/ai/elimu/model) package) get mapped automatically to database tables/columns: [`src/main/resources/META-INF/jpa-persistence.xml`](https://github.com/elimu-ai/webapp/blob/main/src/main/resources/META-INF/jpa-persistence.xml)

However, when _deleting, modifying or renaming_ an entity class/attribute, we have to manually update the underlying database structure.
> [!IMPORTANT]
> However, when _deleting, modifying or renaming_ an entity class/attribute, we have to manually update the underlying database structure.
## Migration Scripts

Every time the webapp completes initialization, the [`DbMigrationHelper`](src/main/java/ai/elimu/util/db/DbMigrationHelper.java) checks if there are any database migration scripts at [`src/main/resources/db/migration`](https://github.com/elimu-ai/webapp/tree/master/src/main/resources/db/migration) matching the current webapp version. You can find the version in [`pom.xml`](pom.xml#L7).
Every time the webapp completes initialization, the [`DbMigrationHelper`](src/main/java/ai/elimu/util/db/DbMigrationHelper.java) checks if there are any database migration scripts at [`src/main/resources/db/migration`](https://github.com/elimu-ai/webapp/tree/main/src/main/resources/db/migration) matching the current webapp version. You can find the version in [`pom.xml`](pom.xml#L7).

## How to Add a New Migration Script

Follow these steps:

1. Lookup the current webapp version in [`pom.xml`](pom.xml#L7)
2. Add a new file to [`src/main/resources/db/migration`](https://github.com/elimu-ai/webapp/tree/master/src/main/resources/db/migration). E.g. `2003004.sql` for version `2.3.4`.
2. Add a new file to [`src/main/resources/db/migration`](https://github.com/elimu-ai/webapp/tree/main/src/main/resources/db/migration). E.g. `2003004.sql` for version `2.3.4`.
3. Add the SQL script that will be executed on the `TEST`/`PROD` server.

## Sample
Expand All @@ -27,4 +28,27 @@ For an example of a previous database migration script, see https://github.com/e

## Caveats 😅

Note that DB migration performed automatically by the ORM provider (Hibernate), e.g. when adding a new property to an @Entity, is executed _before_ our custom migration scripts.
> [!WARNING]
> Note that DB migration performed automatically by the ORM provider (Hibernate), e.g. when adding a new property to an `@Entity`, is executed _before_ our custom migration scripts.
---

<p align="center">
<img src="https://github.com/elimu-ai/webapp/blob/main/src/main/webapp/static/img/logo-text-256x78.png" />
</p>
<p align="center">
elimu.ai - Free open-source learning software for out-of-school children ✨🚀
</p>
<p align="center">
<a href="https://elimu.ai">Website 🌐</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki#readme">Wiki 📃</a>
&nbsp;&nbsp;
<a href="https://github.com/orgs/elimu-ai/projects?query=is%3Aopen">Projects 👩🏽‍💻</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki/milestones">Milestones 🎯</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki#open-source-community">Community 👋🏽</a>
&nbsp;&nbsp;
<a href="https://www.drips.network/app/drip-lists/41305178594442616889778610143373288091511468151140966646158126636698">Support 💜</a>
</p>
7 changes: 7 additions & 0 deletions FUNDING.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0xB1C409722B23Cba26dE8660b180d4B55Ed8CB4c0"
}
}
}
11 changes: 11 additions & 0 deletions FUNDING_SPLITS.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ethereum_address,github_username,impact_percentage
0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1,nya-elimu,51.02
0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0,jo-elimu,38.77
0x3965d420cde24fe00f742cb31257ca90e04556a7,tomaszsmy,1.20
0x819e4F5E912abb36c8f6c03790e7508e03cc37a3,UmenR,1.12
0x5367a6d4F5991327Bb20466684790e394bE000dE,Shubham-Vishwakarma,0.76
0x0000000000000000000000000000000000000000,aschworer,0.73
0x6321286F9B73f427C72e1f9F1bC6b3d25eF06605,hhio618,0.57
0x0000000000000000000000000000000000000000,urosht,0.57
0x4709ebf314c6492d57f4c6d4f57357d5b2bb074e,vrudas,0.56
0x914dBEe36BcAb63B2D15fAED08839Be43797b421,watr-sheep,0.38
56 changes: 45 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ To be able to compile and execute the web application locally, you will first ne
* Java Development Kit (JDK)

* macOS: `brew install openjdk`
* Windows: Download from https://learn.microsoft.com/en-us/java/openjdk/download

* Maven

* macOS: `brew install maven`
* Windows: Download ZIP file from https://maven.apache.org/download.cgi

Go to the project's folder:

cd webapp
cd webapp/

Then, to run the application, type:

Expand All @@ -28,25 +30,57 @@ Next, to access the application in your browser, go to [http://localhost:8080/we

### Debug 🪲

To run the application in debug mode, replace `mvn` with `mvnDebug` in the command above ☝️
> [!TIP]
> To run the application in debug mode, replace `mvn` with `mvnDebug` in the command above ☝️

## Test server
## Code Coverage

http://<language>.test.elimu.ai
[![codecov](https://codecov.io/gh/elimu-ai/webapp/branch/main/graph/badge.svg?token=T1F9OTQVOH)](https://codecov.io/gh/elimu-ai/webapp)

[![](https://codecov.io/gh/elimu-ai/webapp/branch/main/graphs/tree.svg?token=T1F9OTQVOH)](https://codecov.io/gh/elimu-ai/webapp)

## Prod server
```
mvn test
open target/site/jacoco/index.html
```

http://<language>.elimu.ai

## Test server

## Supported languages 🇺🇸🇵🇭🇮🇳🇹🇿
https://<language>.test.elimu.ai

A list of the currently supported languages is available at https://github.com/elimu-ai/model/blob/master/src/main/java/ai/elimu/model/enums/Language.java

The default language used during development is English (`ENG`). To switch to another language, edit the `content.language` property in [src/main/resources/config.properties](src/main/resources/config.properties).
## Prod server

https://<language>.elimu.ai

## Contributing guidelines

For guidelines on how to work on issues, see [CONTRIBUTING.md](CONTRIBUTING.md)
## Supported languages 🇺🇸🇵🇭🇮🇳🇹🇿

A list of the currently supported languages is available at https://github.com/elimu-ai/model/blob/main/src/main/java/ai/elimu/model/v2/enums/Language.java

> [!NOTE]
> The default language used during development is English (`ENG`). To switch to another language, edit the `content.language` property in [src/main/resources/config.properties](src/main/resources/config.properties).
---

<p align="center">
<img src="https://github.com/elimu-ai/webapp/blob/main/src/main/webapp/static/img/logo-text-256x78.png" />
</p>
<p align="center">
elimu.ai - Free open-source learning software for out-of-school children ✨🚀
</p>
<p align="center">
<a href="https://elimu.ai">Website 🌐</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki#readme">Wiki 📃</a>
&nbsp;&nbsp;
<a href="https://github.com/orgs/elimu-ai/projects?query=is%3Aopen">Projects 👩🏽‍💻</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki/milestones">Milestones 🎯</a>
&nbsp;&nbsp;
<a href="https://github.com/elimu-ai/wiki#open-source-community">Community 👋🏽</a>
&nbsp;&nbsp;
<a href="https://www.drips.network/app/drip-lists/41305178594442616889778610143373288091511468151140966646158126636698">Support 💜</a>
</p>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 elimu.ai Community DAO
Copyright (c) 2020 elimu.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 331b94f

Please sign in to comment.