Skip to content

Ejden/exbook-backend

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Exbook

Website for exchanging or buying books with other users

View Demo (Not set up at the moment) · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Features
  5. Contributing
  6. License
  7. Contact

About The Project

Note that this project is in early development!

This is backend part of Exbook web application.

Exbook is web app that will help people sell and exchange their book with other people.

If you want to see frontend code go here.

Backend Built With

Getting Started

To quickly run local Exbook server follow instructions bellow

Docker MongoDB setup

To run this app locally, You want to create mongoDB database first. Create docker stack.yml file and paste this code in this file:

# Use root/example as user/password credentials
version: '3.1'

services:

  mongo:
    image: mongo
    restart: always
    ports:
     - 27017:27017
    environment:
      MONGO_INITDB_DATABASE: exbook
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: password
    volumes:
     - ./data/mongo/init_db_users.js:/docker-entrypoint-initdb.d/init_db_users.js:ro

In folder when you created stack.yml file create data folder, in data folder create mongo folder. In created mongo folder create init_db_users.js file with below structure. This will create basic user in exbook database with read and write privileges:

db.createUser(
    {
        user: "admin",
        pwd: "password",
        roles:[
            {
                role: "readWrite",
                db:   "exbook"
            }
        ]
    }
);

To run database open terminal, go to folder with stack.yml file and type

docker-compose -f stack.yml up

To shutdown database type

docker-compose -f stack.yml down

App secrets in .env file

Application to work needs various secrets like database url or jwt token secret key. In root folder of project create local.env file, and paste bellow code to this file.

JWT_EXP_TIME=36000000
JWT_SECRET=uwkyi43875cny43875ctyb4375btc34t67rtb43g76fb453g7ctg98243n7gfxc7yxn924gx
MONGODB_HOST=localhost
MONGODB_port=27017
MONGODB_DATABASE_NAME=exbook
MONGODB_DATABASE_USERNAME=admin
MONGODB_DATABASE_PASSWORD=password

###Application

To download the latest .jar stable version of server go to releases page. Otherwise, if you want, you can download code from any branch (be carefully, there is no guaranty that this code will run or compile without problems). Just simply clone repo to your IDE and run it with JVM system parameter:

-Dspring.profiles.active=local

This will activate local profile of the application.

Features (backend part)

Implemented

  • Categories
  • Offers
  • Account
  • Offer stock
  • Basket
  • Images
  • Shipping Methods
  • JWT Token Authorization
  • Swagger
  • Searching and filtering offers
  • Displaying offers
  • Exchanging/Buying books
  • Basket
  • Offer versioning
  • Downloading Book info from Google api
  • Searching common shipping method for order group

Not implemented yet

  • Messaging users
  • Basic Recommendations

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPL License. See LICENSE for more information.

Contact

Adrian Stypiński - [email protected] - Mail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages