Git Product home page Git Product logo

dynolog-api's Introduction

Dynolog api

Project structure

.
├── docker-compose.yml
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   ├── com
│   │   │   │   └── github
│   │   │   │       └── dynolog
│   │   │   │           └── api
│   │   │   │               ├── configurations
│   │   │   │               ├── controllers
│   │   │   │               ├── domain
│   │   │   │               ├── errors
│   │   │   │               ├── Main.java
│   │   │   │               ├── middlewares
│   │   │   │               └── utils
│   │   │   └── db
│   │   │       └── migration
│   │   │           └── database migrations (in java)
│   │   └── resources
│   │       ├── application.properties
│   │       ├── db
│   │       │   └── migration
│   │       │       └── database migrations (in SQL)
│   │       ├── messages.properties
│   │       └── messages_pt_BR.properties
│   └── test
│       ├── java
│       │   └── com
│       │       └── github
│       │           └── dynolog
│       │               └── api
│       └── resources
│           └── application.properties
└── system.properties

Table of Contents

Requirements

  • Postgres: ^13
  • Java: ^17
  • Maven: ^3.8.4

Installation

🚨 attention make sure the database exists

you can up a database using docker with "docker-compose up -d postgresql"

# clone the repository and access the directory.
$ git clone [email protected]:appointments-io/appointments-server.git server && cd server

# download dependencies
$ mvn install -DskipTests

# run the application
$ mvn spring-boot:run

# run the tests
$ mvn test

# to build for production
$ mvn clean package

Swagger

Once the application is up, it is available at: localhost:8080/documentation

development server

Tests

Coverage Status

Running a specific test

use the parameter -Dtest=<class>#<method>

for example the integration test. create token:

$ mvn test -Dtest=SessionControllerTests#should_return_OK_when_password_is_correct

Database Migrations

Creating database migration files

  • Java based migrations

    mvn migration:generate -Dname=my-migration-name
  • SQL based migrations

    mvn migration:generate -Dname=my-migration-name -Dsql

Environment variables

Descrição Parameter Default values
Server port SERVER_PORT 8080
database url DB_URL localhost:5432/appointments
username (database) DB_USERNAME root
user password (database) DB_PASSWORD root
displays the generated sql in the logger DB_SHOW_SQL false
set maximum database connections DB_MAX_CONNECTIONS 5
secret value in token generation TOKEN_SECRET secret
token expiration time in hours TOKEN_EXPIRATION_IN_HOURS 24
refresh token expiry time in days REFRESH_TOKEN_EXPIRATION_IN_DAYS 7
max requests per minute MAX_REQUESTS_PER_MINUTE 10

these variables are defined in: application.properties

# to change the value of some environment variable at runtime
# on execution, just pass it as a parameter. (like --SERVER_PORT=80).
$ java -jar appointments-io-0.0.1-SNAPSHOT.jar --SERVER_PORT=80

dynolog-api's People

Contributors

throyer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.