Skip to content

Fixes and updates #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
50be9f2
prebuild app
bfwg May 22, 2017
04ce786
Merge branch 'master' into pre-build
bfwg May 22, 2017
1ba1ed5
pre-build frontend
bfwg May 22, 2017
ceedf16
Merge branch 'master' into pre-build
bfwg May 22, 2017
736b3c5
Update pre-build
bfwg May 22, 2017
798dce4
Update build
bfwg May 22, 2017
c36df3e
Merge branch 'master' into pre-build
bfwg May 22, 2017
d8844fc
Update build
bfwg May 22, 2017
54c43f6
Merge branch 'master' into pre-build
bfwg Jun 19, 2017
632a2b5
update build
bfwg Jun 19, 2017
3cefb04
update pre-build
bfwg Jul 30, 2017
a5d54a8
Merge branch 'master' into pre-build
bfwg Aug 7, 2017
af42d12
update pre-build
bfwg Aug 7, 2017
9d341c9
fix unit test
bfwg Oct 23, 2017
2c9ff0c
Added docker enviroment with docker-compose and docker files for back…
apeixinho Nov 12, 2017
8411728
Added dockerfiles for frontend.
apeixinho Nov 12, 2017
79c01f7
Merge branch 'master' into pre-build
bfwg Nov 21, 2017
b74fddb
Merge branch 'pre-build' of github.com:bfwg/angular-spring-jwt-starte…
bfwg Nov 21, 2017
88ced2c
Resolved package.json conflits with upgrade of minor versions.
apeixinho Nov 23, 2017
cce8b1e
Changed angular app dockerfile build from mhart/alpine-node to offici…
apeixinho Nov 23, 2017
0433750
Review of npm start script in package.json. Added 'echo' to hostname…
apeixinho Nov 23, 2017
c63f61d
update frontend angular version (#37)
bfwg Nov 26, 2017
68134d8
Updated server docker production file
apeixinho Dec 13, 2017
a66c049
Merge branch 'pre-build' of github.com:bfwg/angular-spring-starter
apeixinho Dec 17, 2017
3c28fd7
Merge branch 'fix-unit-test' of github.com:bfwg/angular-spring-starter
apeixinho Dec 17, 2017
3b47470
Added /node_modules to gitignore. Removed node_modules directory
apeixinho Dec 17, 2017
45748e4
Added src/main/static/resources to gitignore in server backend
apeixinho Dec 17, 2017
5527b84
Merge from master. Added gitignore to root folder
apeixinho Dec 17, 2017
de83b4e
Pushed up springboot version
apeixinho Dec 17, 2017
198f871
fixed typo in login.component.ts. updated docker-compose version
apeixinho Dec 17, 2017
ab1a902
Removed server port specification 8081, back to default 8080. Fixed t…
apeixinho Dec 17, 2017
89f3864
Added gitignore to root folder. Fixed typo in login.component.ts
apeixinho Dec 17, 2017
516dfe9
Upgraded SpringBoot and rest-assured version in pom.xml
apeixinho Feb 24, 2018
e0ce245
Merge from dev branch
apeixinho Feb 24, 2018
590433c
Deleted DS_Store file
apeixinho Feb 24, 2018
e83e2ff
Merge from upstream
apeixinho Feb 24, 2018
d5c8bba
Typo in signup component.ts
apeixinho Feb 24, 2018
0cacb32
Code cleanup. Changed some access policy to private instead of public.
apeixinho Mar 3, 2018
fed18c1
Updated gitignore to handle Netbeans IDE
apeixinho Mar 3, 2018
6c10e1e
access policy for some method wasn't specified, this make them public.
apeixinho Mar 3, 2018
ae27329
Removed all docker implementation. Its has now its own branch docker-env
apeixinho Mar 3, 2018
815fa3f
Fix e2e test, wrong paragraph specification
apeixinho Mar 3, 2018
8e0d9c0
Bad comment on gitignore
apeixinho Mar 3, 2018
08d0a8a
Uncommented wrong comment on gitignore
apeixinho Mar 3, 2018
a5bda27
Changed dockerfile names
apeixinho Mar 28, 2018
cf9ea1d
Bumped up versions in package.json
apeixinho Apr 19, 2018
8628e12
Docker Environment (#47)
apeixinho Jun 18, 2018
ad78c1e
Merge changes from upstream
apeixinho Jun 22, 2018
df4a94e
Merge branch 'master' of github.com:bfwg/angular-spring-starter into …
bfwg Oct 15, 2018
394a711
feat: update doecker prod file
bfwg Oct 19, 2018
d672fbd
update build outdir
bfwg Oct 19, 2018
2980587
updated gitignore add yarn.lock
apeixinho Feb 4, 2019
e03b1ee
updated package.json dependencies
apeixinho Feb 4, 2019
ebd9861
changed travis ci url
apeixinho Feb 4, 2019
26465b5
wrong space in docker-compose
apeixinho Aug 15, 2019
8313589
Merge remote-tracking branch 'upstream/master'
apeixinho May 3, 2020
98ed9e6
Merge remote-tracking branch 'upstream/docker' into docker
apeixinho May 3, 2020
4f2f4ef
fix maven jdk versions
apeixinho May 4, 2020
f89bace
Merge branch 'master' into docker
apeixinho May 4, 2020
8b748f4
unification of frontend with upstream master
apeixinho May 4, 2020
b7bcec7
Unification with upstream master
apeixinho May 4, 2020
ba04247
Merge branch 'master' into docker
apeixinho May 4, 2020
1bcb7df
unification with master branch
apeixinho May 4, 2020
1121fe2
wrong option deprecated in current Angular NG
apeixinho May 4, 2020
96c5477
adjust config api to docker container name
apeixinho May 4, 2020
a337f6d
Renamed server folder to backend. Updated dockerfiles
apeixinho Mar 2, 2022
46ca815
Merge branch 'bfwg:master' into master
apeixinho Aug 11, 2022
d723059
Sync Readme
apeixinho Feb 18, 2023
ac0c635
sync readme
apeixinho Feb 18, 2023
44a115e
updated package.json minor versions
apeixinho Feb 18, 2023
1bbd24b
Angular 9 Compiler requires
apeixinho Feb 18, 2023
a6f5548
Merge pull request #1 from apeixinho/docker
apeixinho Feb 18, 2023
cd6a105
Removed unnecessary TODO.
apeixinho Feb 21, 2023
a2d4fe7
updated gitignore
apeixinho Apr 8, 2024
37a767f
update gitignore
apeixinho Oct 12, 2024
8cae8fc
Fix for signup and button toogle. Differentiate between container and…
apeixinho Oct 12, 2024
20d633f
Merge branch 'dev' into docker
apeixinho Oct 12, 2024
cf2e0e5
updated readme
apeixinho Oct 12, 2024
b746f16
Merge pull request #2 from apeixinho:dev
apeixinho Oct 12, 2024
31788ec
updated readme
apeixinho Oct 12, 2024
1d71f10
updated readme. fix markdown warnings.
apeixinho Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CVS
.git
.gitignore

# Dockerfile
Dockerfile
Dockerfile-prod

# compiled output
dist
tmp
sme
target

# dependencies
node_modules
bower_components

# IDEs and editors
.idea
.vscode
.project
.classpath
*.launch
.editorconfig
.settings/
nbproject/

# misc
.sass-cache
connect.lock
coverage/*
libpeerconnection.log
npm-debug.log
testem.log
typings
README.md

# e2e
e2e/*.js
e2e/*.map

#System Files
.DS_Store
Thumbs.db
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

### STS ###
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
nb-configuration.xml
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
#!.vscode/settings.json
# #!.vscode/tasks.json
# #!.vscode/launch.json
# #!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
package-lock.json
target/
!.mvn/wrapper/maven-wrapper.jar


### frontend ###
npm-debug.*
src/main/resources/static/
/frontend/nbproject/private/
110 changes: 85 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,87 @@
# Angular Spring Boot JWT Starter

[![npm](https://img.shields.io/badge/demo-online-ed1c46.svg)](http://angular-spring-starter.fanjin.io/)
[![StackShare](https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/bfwg/angular4-spring-boot-jwt-starter)
[![Build Status](https://travis-ci.org/bfwg/angular-spring-starter.svg?branch=master)](https://travis-ci.org/bfwg/angular-spring-starter)
[![Maintenance Status][status-image]][status-url]
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bfwg/angular-spring-jwt-starter/blob/master/LICENSE)

<p align="center">
<a href="http://angular-spring-starter.fanjin.io" target="_blank">
<img src="https://cloud.githubusercontent.com/assets/12819525/26094670/b0f6f192-39cf-11e7-8048-ab710b3dc1d1.png" alt="Spring Boot and Angular 2" width="500" height="320"/>
</a>
</p>
![http://angular-spring-starter.fanjin.io](https://cloud.githubusercontent.com/assets/12819525/26094670/b0f6f192-39cf-11e7-8048-ab710b3dc1d1.png)

# Angular Spring Boot JWT Starter
> An Angular full stack starter kit featuring [Angular](https://angular.io), [Router](https://angular.io/docs/ts/latest/guide/router.html), [Forms](https://angular.io/docs/ts/latest/guide/forms.html),
[Http](https://angular.io/docs/ts/latest/guide/server-communication.html),
[Services](https://gist.github.com/gdi2290/634101fec1671ee12b3e#_follow_@AngularClass_on_twitter),
[Spring boot](https://projects.spring.io/spring-boot/),
[JSON Web Token](https://jwt.io/)

> If you're looking to use Angular as your frontend implementation, please check out [springboot-jwt-starter](https://github.com/bfwg/springboot-jwt-starter)
> A Spring Boot token-based security starter kit featuring [AngularJS](https://angularjs.org/) and [Spring Boot](https://projects.spring.io/spring-boot/) ([JSON Web Token](https://jwt.io/))
<p align="center">
<img width="800" alt="Springboot JWT Starter" src="https://cloud.githubusercontent.com/assets/12819525/26290994/3895daca-3e60-11e7-9465-421e0b029343.png">
</p>

## Quick start
**Make sure you have Maven and Java 11 or greater**
**Make sure you also have NPM 6.12.0, Node 12.13.0 and angular-cli@9.1.3 globally installed**
> A Spring Boot token-based security starter kit featuring [Angular](https://angular.dev/) and [Spring Boot](https://projects.spring.io/spring-boot/) ([JSON Web Token](https://jwt.io/))

![Springboot JWT Starter](https://cloud.githubusercontent.com/assets/12819525/26290994/3895daca-3e60-11e7-9465-421e0b029343.png)

## Table of Contents

- [Quick start with docker](#quick-start-with-docker)
- [Recipe to install docker-compose on Linux](#recipe-to-install-docker-compose-on-linux)
- [Quick start without docker](#quick-start-without-docker)
- [Deployment](#deployment)
- [JSON Web Token](#json-web-token)
- [Importing the Project in IntelliJ IDEA](#importing-the-project-in-intellij-idea)

## Quick start with docker

You'll need docker and docker-compose installed.

In order to install __docker__ and __docker-compose__ follow these:

1. [docker](https://docs.docker.com/install) installation

2. [docker compose](https://docs.docker.com/compose/install/) installation

> on Linux check [docker-compose recipe](#recipe-to-install-docker-compose-on-linux)
3. check __docker__ and __docker-compose__ installation, issue the following command on a terminal or console:

```bash
docker --version
Docker version 17.12.0-ce, build c97c6d6 # or similar to 17.1x.x
docker-compose --version
docker-compose version 1.18.0, build 8dd22a9 # or similar to 1.1x.x
```

```bash
# clone our repo
# --depth 1 removes all but one .git commit history
git clone --depth 1 https://github.com/bfwg/angular-spring-starter.git
# issue docker-compose to start services, these will start in background mode as denoted by the -d flag
docker-compose up -d
# if everything builds successfully you should see something similar to:
Successfully built 0017f554842f
Successfully tagged angular-spring-starter_angular:latest
Creating angular-spring-starter_springboot_1 ... done
Creating angular-spring-starter_angular_1 ... done
# the app will be available at localhost
# if you wish to see your newly created containers issue:
docker ps
# if you wish to have access to a running shell inside a running container you can issue:
docker exec -it <container name> sh
```

### Recipe to install docker-compose on Linux

To install __docker-compose__ under a GNU/nix system, one could use the following enchantment:

```bash
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1` # get latest docker-compose version
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" # download and extract to /usr/local/bin with appropriate permissions, this should be already in your $PATH
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose" # docker-compose bash completions ... why not ?!
```

## Quick start without docker

__Make sure you have Maven and Java 11 or greater__
__Make sure you also have NPM 6.12.0, Node 12.13.0 and angular-cli@9.1.3 globally installed__

```bash
# clone our repo
# --depth 1 removes all but one .git commit history
@@ -42,24 +98,26 @@ npm install
npm start

# change directory to the repo's backend folder
cd ../server
cd ../backend

# install the server dependencies with mvn
mvn install

# start the backend server
mvn spring-boot:run

# the fronend angular app will be running on port 4200
# the frontend angular app will be running on port 4200
# the spring-boot server will be running on port 8080
```

There are two user accounts present to demonstrate the different levels of access to the endpoints in
the API and the different authorization exceptions:
```

```bash
Admin - admin:123
User - user:123
```

For more detailed configuration/documentation, please check out the [frontend][frontend-doc] and [server][server-doc] folder.

## Deployment
@@ -80,7 +138,7 @@ npm install
ng build

# change directory to the repo's backend folder
cd ../server
cd ../backend

# install the server dependencies with mvn
mvn install
@@ -89,18 +147,21 @@ mvn install
mvn spring-boot:run

# the app will be running on port 8080

```

For more deployment related info checkout here: [DEPLOYMENT DOC](https://angular.io/docs/ts/latest/guide/deployment.html)

### JSON Web Token
> JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
for more info, check out https://jwt.io/

> JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
> For more info, check out [https://jwt.io/](https://jwt.io/).
> Token authentication is a more modern approach and is designed solve problems session IDs stored server-side can’t. Using tokens in place of session IDs can lower your server load, streamline permission management, and provide better tools for supporting a distributed or cloud-based infrastructure.
>
> -- <cite>Stormpath</cite>
> -- *Stormpath*

### Importing the Project in IntelliJ IDEA

1. Click "Import Project" on the launch screen
2. Select the projects root folder, then select "Import project from external model" and choose "Maven"
3. Tick the checkboxes "Import Maven projects automatically" and "Import projects recursively"
@@ -112,21 +173,20 @@ for more info, check out https://jwt.io/
9. You should now see both (frontend and backend) modules in the Project view

### Contributing

I'll accept pretty much everything so feel free to open a Pull-Request

This project is inspired by

- [Stormpath](https://stormpath.com/blog/token-auth-spa)
- [Cerberus](https://github.com/brahalla/Cerberus)
- [jwt-spring-security-demo](https://github.com/szerhusenBC/jwt-spring-security-demo)

___

## License
[MIT](/LICENSE)

[MIT](/LICENSE)

[frontend-doc]: https://github.com/bfwg/angular-spring-jwt-starter/tree/master/frontend
[server-doc]: https://github.com/bfwg/angular-spring-jwt-starter/tree/master/server
[status-image]: https://img.shields.io/badge/status-maintained-brightgreen.svg
[status-url]: https://github.com/bfwg/angular-spring-jwt-starter

45 changes: 45 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CVS
.git
.gitignore

# Dockerfile
Dockerfile
Dockerfile-prod

# compiled output
dist
tmp
sme
target

# dependencies
node_modules
bower_components

# IDEs and editors
.idea
.vscode
.project
.classpath
*.launch
.editorconfig
.settings/
nbproject/

# misc
.sass-cache
connect.lock
coverage/*
libpeerconnection.log
npm-debug.log
testem.log
typings
README.md

# e2e
e2e/*.js
e2e/*.map

#System Files
.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions server/.gitignore → backend/.gitignore
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ target/
*.ipr

### NetBeans ###
nb-configuration.xml
nbproject/private/
build/
nbbuild/
File renamed without changes.
Loading