All Projects → techdev-solutions → Trackr Backend

techdev-solutions / Trackr Backend

Licence: mit

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Trackr Backend

Ebook Chat App Spring Websocket Cassandra Redis Rabbitmq
Pro Java Clustering and Scalability: Building Real-Time Apps with Spring, Cassandra, Redis, WebSocket and RabbitMQ
Stars: ✭ 186 (-6.06%)
Mutual labels:  spring-boot
Resteasy Spring Boot
RESTEasy Spring Boot Starter
Stars: ✭ 190 (-4.04%)
Mutual labels:  spring-boot
Java Microservices Examples
Java Microservices: Spring Boot, Spring Cloud, JHipster, Spring Cloud Config, and Spring Cloud Gateway
Stars: ✭ 194 (-2.02%)
Mutual labels:  spring-boot
Springcloud Miaosha
一个基于spring cloud Greenwich的简单秒杀电子商城项目,适合新人阅读。A simple spring cloud based seckill shopping mall project, suitable for young people to read. It can be used as a paper material for academic defense.
Stars: ✭ 187 (-5.56%)
Mutual labels:  spring-boot
Oauth2 Family Barrel
OAuth2全家桶项目。本项目演示了如何使用spring-boot、spring-security以及spring-security-oauth快速构建OAuth2服务框架体系。
Stars: ✭ 188 (-5.05%)
Mutual labels:  spring-boot
Hope
🎨 Java 学习
Stars: ✭ 192 (-3.03%)
Mutual labels:  spring-boot
Mcloud
基于Spring Cloud,实现微服务中常用的基础模块,包括 OAuth2 认证服务,统一注册中心,系统监控中心, 统一配置中心,API网关以及熔断器
Stars: ✭ 185 (-6.57%)
Mutual labels:  spring-boot
Springcloud Shop
基于Spring Boot、Spring Cloud的微服务商城demo
Stars: ✭ 198 (+0%)
Mutual labels:  spring-boot
Spring Webflux Security Jwt
A JWT authorization and authentication implementation with Spring Reactive Webflux, Spring Boot 2 and Spring Security 5
Stars: ✭ 190 (-4.04%)
Mutual labels:  spring-boot
Material Admin
A Material Designed Admin Framework based on Spring boot2 And Bootstrap
Stars: ✭ 196 (-1.01%)
Mutual labels:  spring-boot
Jpa Hibernate Tutorials
Hibernate Tutorials with Spring Boot and Spring-Data-JPA
Stars: ✭ 186 (-6.06%)
Mutual labels:  spring-boot
Kogito Runtimes
Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
Stars: ✭ 188 (-5.05%)
Mutual labels:  spring-boot
Him Netty
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 194 (-2.02%)
Mutual labels:  spring-boot
Springboot Learning
《Spring Boot基础教程》,2.x版本持续连载中!点击下方链接直达教程目录!
Stars: ✭ 13,916 (+6928.28%)
Mutual labels:  spring-boot
Embedded Database Spring Test
A library for creating isolated embedded databases for Spring-powered integration tests.
Stars: ✭ 196 (-1.01%)
Mutual labels:  spring-boot
Ms
🔥MS 是一个前后分离的分布式 spring cloud 框架(全家桶),这里有统一认证,统一网关等等功能,是一个非常简洁的微服务脚手架
Stars: ✭ 186 (-6.06%)
Mutual labels:  spring-boot
Ddd Java
Spring Boot + Java [ DDD Sample ]
Stars: ✭ 191 (-3.54%)
Mutual labels:  spring-boot
Awesome Spring Boot
springboot 各种资料整理(demo、教程、网站、starter文档等),持续更新,欢迎pr。
Stars: ✭ 198 (+0%)
Mutual labels:  spring-boot
Blog
MyBlog
Stars: ✭ 197 (-0.51%)
Mutual labels:  spring-boot
Event Driven Spring Boot
Example Application to demo various flavours of handling domain events in Spring Boot
Stars: ✭ 194 (-2.02%)
Mutual labels:  spring-boot

trackr backend

What is it?

trackr is an application to track petty much everything that is going on in your company. Keep track of vacations, sick days, invoices and many more.

trackr comes with a Java-based backend and a frontend written in AngularJS. This project is the Java/Spring based backend, a stateless REST API with either OAuth2 or basic authentication.

You can read all about trackr in our developer blog:

For the API documentation just go here. There is also a Vagrant project building the whole application over here.

How to start

If you just want to mess around with the API a bit the default configuration is very sensible and has no external dependencies (well, except Java).

If you have gradle, just run

gradle run

If you don't have gradle and want to use the wrapper run

./gradlew run
# or
gradlew.bat run

If you want to start from your IDE, i.e. for debugging open the class Trackr and start the main method.

To verify it works you can use curl. The users don't have a password in this configuration, so just press enter when curl asks for one. If you don't like the usernames change them in import.sql.

curl --user [email protected] localhost:8080

The default config uses port 8080, if that is used on your system you can add

server:
    port: $port

to the top of the application.yaml and choose a port that you want for $port.

Profiles

trackr has a lot of Spring profiles to add/switch features.

profile description notes
in-memory-database uses a H2 database, creates the schema with hibernate excluse with real-database
real-database uses a configurable database, executes flyway exclusive with in-memory-database
http-basic protects the API with HTTP basic authentication exclusive with oauth
oauth protects the API as a OAuth2 resource server exclusive with http-basic. Database for OAuth2 tokens needed.
granular-security roles and per endpoint security
gmail sends mail with Gmail and enables mail receiving when off, does not receive mails and uses a logging mail sender.
dev initialize the database with data.sql
prod Just some different settings for our production env

Take a look in the application.yaml to see what properties these profiles need.

The default profiles are in-memory-database,dev,granular-security,http-basic. If you want to use other profiles, there are several possible ways.

  1. You can change the spring.profiles.active value in application.yaml
  2. If you use gradle run you can prepend (example) SPRING_PROFILES_ACTIVE=dev,gmail,real-database. You can also use this to overwrite e.g. the port with SERVER_PORT=8000.
  3. If you run from your IDE, you can add --spring.profiles.active=dev,gmail,real-database as program arguments to the run configuration.

Please refer to the Spring Boot Reference for more information.

The oauth profile

The oauth profile marks the trackr backend as a OAuth2 resource server, that means access is only possible with a valid access token issued by an authorization server. We use a JDBC token store, so valid tokens need to be put there. Please take a look at our (soon to be open sourced) techdev portal to see how we do this.

The granular-security profile

When this is not selected, to access the API the user needs to be authenticated. With granular security the access to some endpoints depend on the role of the user or even the id of the user. In trackr, the id of a user is the email address of the belonging employee.

When the oauth profile is switched off, all users have the role ROLE_ADMIN. When oauth is on, the roles must be stored in the access token.

Take a look at the @PreAuthorize and @PostAuthorize annotations in the code to see what this will activate.

How to build

Just run

gradle build

(or use the wrapper if you don't have gradle installed). The JAR file will be in build/libs and can just be run with java -jar. The application.yaml file has to be in the working directory where the java command was issued.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].