Artventuria API
May 2, 2025 ยท View on GitHub
API backend for the Artventuria application, enabling the management of artworks, badges, points, and social interactions.
๐ Features
- Authentication and authorization with JWT
- Artwork and collection management
- Points system and ranking
- NFC tag validation
- Firebase notification system
- API documentation with Swagger
๐ ๏ธ Technologies
- Java 21
- Spring Boot 3.x
- PostgreSQL 16
- MongoDB 5
- Kafka & Zookeeper
- Firebase
- Spring Security
- Spring Data JPA/MongoDB
- Logback
- Swagger/OpenAPI
- Terraform
- Docker
- AWS
๐ Prerequisites
- Java 21
- Maven 4.0.0 or higher
- Docker and Docker Compose
- AWS CLI (for deployment)
๐ง Installation
- Clone the repository:
git clone https://github.com/Artventuria/API.git
cd API
- Install dependencies:
make deps
# or manually: ./mvnw dependency:resolve
- Set up development environment:
# Start required services (PostgreSQL, MongoDB)
docker-compose up -d
- Configure environment variables in
.envfile (for local development)
๐ Running the Application
To run the application in development mode:
make dev
# or manually: ./mvnw spring-boot:run -Pdev
To run the application in production mode:
make run
# or manually: ./mvnw spring-boot:run -Pprod
๐๏ธ Build
To build the application:
make build
# or manually: ./mvnw package
To build for Linux (for deployment):
make linux64
๐งช Tests
Run tests:
make test
# or manually: ./mvnw test
With code coverage:
make test_coverage
# or manually: ./mvnw verify
๐ API Documentation
Swagger documentation is automatically generated and available at:
http://localhost:8081/swagger-ui.html
To generate OpenAPI docs:
make openapi
๐ Code Quality
To run code quality checks:
make lint
# or manually: ./mvnw checkstyle:check
๐๏ธ Database Management
Run migrations:
make migrate
# or manually: ./mvnw flyway:migrate
View migration info:
make migrate_info
Clean and reapply migrations:
make migrate_clean
๐ณ Docker
Build and run with Docker:
# Development environment
docker-compose up -d
# Production environment
docker-compose -f docker-compose.prod.yml up -d
๐ข Deployment
The project uses GitHub Actions for CI/CD. To deploy:
- Create a tag with version number:
git tag v1.0.0
git push origin v1.0.0
- GitHub Actions will automatically:
- Build the application
- Create a Docker image
- Push to Docker Hub
- Deploy to the production server
๐ Project Structure
.
โโโ .deploy/ # Deployment configuration
โโโ .github/ # GitHub workflows (CI/CD)
โโโ src/
โ โโโ main/
โ โ โโโ java/
โ โ โ โโโ com/artventuria/api/
โ โ โ โ โโโ config/ # Application configuration
โ โ โ โ โโโ controller/ # REST controllers
โ โ โ โ โโโ dto/ # Data Transfer Objects
โ โ โ โ โโโ exception/ # Custom exceptions
โ โ โ โ โโโ domain/ # Domain models
โ โ โ โ โโโ repository/ # Data access layer
โ โ โ โ โโโ security/ # Security configuration
โ โ โ โ โโโ service/ # Business logic
โ โ โโโ resources/ # Application resources
โ โโโ test/ # Test files
โโโ terraform/ # Infrastructure as Code
โโโ docker-compose.yml # Development services
โโโ docker-compose.prod.yml # Production services
โโโ Makefile # Development commands
โโโ pom.xml # Project dependencies
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.