- Scala 99.5%
- Dockerfile 0.5%
| .github/workflows | ||
| .junie | ||
| domain | ||
| domain-test/src | ||
| remote-storage | ||
| remote-storage-test/src | ||
| repository-postgres/src | ||
| repository-test-postgres/src/scala | ||
| web/src | ||
| .env.exemple | ||
| .gitignore | ||
| .nixpacks.toml | ||
| .scalafix.conf | ||
| .scalafmt.conf | ||
| .sdkmanrc | ||
| bleep.yaml | ||
| CLAUDE.md | ||
| CONFIGURATION_CHANGES.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| GEMINI.md | ||
| qodana.yaml | ||
| README.md | ||
| REFACTORING_SUGGESTIONS.md | ||
| test.pdf | ||
Car Sharing Backend
This project is a Scala 3 application using PostgreSQL for database management and Bleep for build automation. Test
Prerequisites
- Scala 3
- PostgreSQL
- Bleep
Setup
Install PostgreSQL
Install PostgreSQL on your system and create a database:
createdb car
Install Bleep
Follow the Bleep installation guide to install Bleep on your system.
Configuration
-
PostgreSQL Configuration:
Ensure that PostgreSQL is running and properly configured. Set the following environment variables:
export DATABASE_URL="jdbc:postgresql://localhost:5432/car" export DATABASE_USER="myuser" export DATABASE_PASSWORD="mypassword" -
Application Configuration:
The application uses ZIO Config to load configuration from
application.conf.To set up your configuration:
-
Copy the example configuration file:
cp domain/src/resources/application.conf.example domain/src/resources/application.conf -
Edit the
application.conffile with your settings:- WebDAV/NextCloud connection settings (username, password, URL)
- Authentication settings (secret key, token expiration)
-
For production, you can set environment variables instead:
NEXTCLOUD_USERNAME- Your NextCloud usernameNEXTCLOUD_PASSWORD- Your NextCloud passwordNEXTCLOUD_URL- Your NextCloud URLNEXTCLOUD_BASE_PATH- Base path for files (default: "voiture")AUTH_SECRET_KEY- Secret key for JWT token generationAUTH_TOKEN_EXPIRATION_SECONDS- Token expiration time in seconds
Note: The
application.conffile is excluded from version control to prevent committing sensitive data. -
-
Bleep Configuration:
Initialize Bleep in your project directory:
bleep new
Usage
Compile the Project
To compile the project, run:
bleep compile web
Run the Project
To run the project, use:
bleep run web
Test the Project
To execute tests, run:
bleep test repository-test-postgres
Project Structure
domain/: Core business logic, models, service traitsrepository-postgres/: PostgreSQL persistence using Doobie + Flywayremote-storage/: WebDAV/NextCloud file storageweb/: HTTP API layer using Tapirbleep.yaml: Bleep build configuration file
Database Migrations
This project uses Flyway for database migrations. Migration files are located in repository-postgres/src/resources/db/migration/.
Migrations are automatically applied on application startup.
Additional Resources
- Scala 3 Documentation
- PostgreSQL Documentation
- Bleep Documentation
- Doobie Documentation
- Flyway Documentation
License
This project is licensed under the MIT License. See the LICENSE file for details.