Skip to content

Library is project where people can add books, vote books and manage books they have read or will read

License

Notifications You must be signed in to change notification settings

Tsvetoslav88/library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bike

Bike is a project for managing of bike. It consists of Back-end part(Spring boot REST API) and Front-end(Angular). The idea of the project is to demonstrate how Angular and Spring boot work together.

It provides folloing functionality:

  • Show all bikes which are available in the DB (public)
  • Purchase a bike (only for register users)
  • Bike registration (only for admin users)
  • User registration (only for admin users)

The entry point for a user is a website which is available under the address: https://localhost:4200/


Start up information

Docker

In order to run this application you need to install two tools: Docker & Docker Compose.

Instructions how to install Docker on Ubuntu, Windows , Mac .

Dosker Compose is already included in installation packs for Windows and Mac, so only Ubuntu users needs to follow this instructions .

How to run it?

  1. Build back-end project - mvn clean install
  2. Build front-end project - ng build --prod

Now the entire application can be ran with a single command in a terminal:

$ docker-compose up -d

If you want to stop it use following command:

$ docker-compose down

Heroku

  1. If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key. heroku login

  2. Create new Heroku applications

    • library

      • in library folder - heroku create
      • rename the application - heroku apps:rename --app floating-sea-59474 personal-bookstore
    • library-ui

      • in library-ui folder - heroku create
      • rename the application - heroku apps:rename --app floating-sea-59474 personal-bookstore-ui
  3. Create a new Git repository Initialize a git repository in a new or existing directory

    • cd library/ or cd library-ui
    • git init
    • heroku git:remote -a {{app-name}}
  4. Deploy your application Commit your code to the repository and deploy it to Heroku using Git.

    • git add .
    • git commit -am "make it better"
    • git push heroku master
  5. Update in library-ui prod env(environment.prod.t) pointing to back-end heroku URL (baseUrl)

Standalone project

  1. Library server (Back-end) --> Run the Spring boot project in current IDE

  2. Library UI (Front-end) --> Run Angular project using following command - npm run local


Development information

Bike(REST API)

This is a Spring Boot (Java) based application that connects with a database that and expose the REST endpoints that can be consumed by frontend. It supports multiple HTTP REST methods like GET, POST, PUT and DELETE

Full list of available REST endpoints could be found in Swagger UI, which could be called using link: https://localhost:9090/swagger-ui.html

This app is put in Docker container and its definition can be found in a file bike/Dockerfile.

  1. Tech stack

  2. Building and running as a standalone application

    • Build project from using Maven - mvn clean install
    • Execute already built jar file = java -jar target/bike-0.0.1-SNAPSHOT.jar
  3. Testing APIs

    • Load Bike.postman_collection.json collection into Postman and run some of the requests

Note: The Sqlite DB automationly created and populated with predefined data.

Bike-ui(Front-end)

This is a real endpoint for a user where they can review and manipulate their bikes. It consumes the REST API endpoints provided by bike.

This app is put in Docker container and its definition can be found in a file bike-ui/Dockerfile.

It can be entered using link: https://localhost:4200/

  1. Prerequisites

Note: Check if the back-end part is up and runnig

  1. Building and running as a standalone application
    • Build of the project - npm install
    • Run the project - npm start
  1. Prod building and runnig
    • Build it - ng build --prod
    • Run it and access it - node server.js

About

Library is project where people can add books, vote books and manage books they have read or will read

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published