The Filmland API Backend allows performing following operation. Equipped with 🔐 Stateless REST JWT based Bearer token
authentication
- Get all available categories for subscription in FilmLand
- Subscribe to category
- Share your subscription
- Create User
- Login with user details
- Validations for users
- username and password should be at least 8 characters long.
- Validations for Subscriptions
email
should be same as logged in users emailcustomer
can be left empty- Only a person who subscribed intially can share that subscription with other user
- One user can subscribe to any category only once
- Java 8
- Spring-Boot
- JPA
- In-Memory Database H2
- Maven
- Git bash
- Checkout the code / Download from git repo()
- checkout : open git bash and run command
git clone https://github.com/Abhinav2510/FilmLand.git
- Option 1: Maven way of running
- open command prompt(cmd) or terminal on Mac
- navigate to the project folder
- run command
mvn clean install
- once its successfully build run command
mvn spring-boot: run
Now application is up and running on http://localhost:8080
- Open the URL in your browser : http://localhost:8080
- User will see a swagger page with all the defined specs of the service.
- There will have 2 Tags you can see.
- Endpoint 1:
POST /users/signup
- Allows creation of user
- Endpoint 2:
POST /users/signin
- Allows user to login
- On providing correct credential in request the response provides Bearer token in header which can be used for calling further API
- All the below endpoints are secured with stateless JWT authentication.
- All request to below Endpoints should contain custom header
authorization
with value containingBearer {JWT}
- Endpoint 1:
POST /categories/
- subscribe to category or share subscription with another user
- Endpoint 2:
GET /catefories/
- get all the available categories and subscribed available for subscriptions
####Running application
- Run application using
mvn spring-boot: run
- Navigate to http://localhost:8080
- under
user-controller
tab you can create user or use already created user to authenticate - to create user use
/users/signup
endpoint - to Use default user for application use below JSON object for
user/signin
{
"email":"user@test.com",
"password":"password1234"
}
{
"email":"user2@test.com",
"password":"password1234"
}
- It will return response header
authorization
with JWT token - Copy the value in
authorization
header - On top left corner click on Authorize button and enter copied value
Now you should be able to call all the APIs without needing to specify authorization
header manually