Code Monkey home page Code Monkey logo

ebordy's Introduction

Practices for the development of secure software

Description

"Practices for the development of secure software" is a project focused on implementing secure software development practices.

Table of Contents

Requirements

Installation

APP (ReactJS)

  1. Clone the repository:

    git clone https://github.com/Vukajlo01/Osnove-informacione-bezbednosti.git
  2. Navigate to the project directory:

    cd Osnove-informacione-bezbednosti/app
  3. Install dependencies:

    npm install

API (ExpressJS)

  1. Navigate to the api project directory:

    cd Osnove-informacione-bezbednosti/app
  2. Install dependencies:

    npm install

Usage

To start the development server, run:

npm run startdev

This command will start the server locally and make it accessible at http://localhost:port. Replace port with the appropriate port number specified in your environment variables.


API Endpoints

Following API endpoints are available:

Users

  • POST /api/user/create: Creates a new user. Requires uid, email, firstName, lastName, date, and u_role in the request body. Returns status codes and payload based on user creation.
  • POST /api/user/newAccount: Creates a new user account in the Firebase Authentication database and Firestore. Requires uid, userProperties, and userData in the request body. Responds with status codes and payload based on the account creation process.
  • POST /api/user/getById: Retrieves user details by UID. Requires uid in the request body. Returns user data or appropriate error messages.
  • POST /api/user/getRoleByUid: Retrieves the role of a user by UID. Requires uid in the request body. Responds with the user's role or error messages.
  • POST /api/user/get: Retrieves all users. Requires appropriate authorization (e.g., admin role) to access. Returns user data or permission error.
  • POST /api/user/updatePicture: Updates a user's profile picture. Requires uid and photoBase64 in the request body. Responds with success status or errors.
  • POST /api/user/update: Updates a user's profile. Requires uid, firstName, lastName, and date in the request body. Returns updated user data or error messages.
  • POST /api/user/update/admin: Allows an admin to update user data. Requires uid and data in the request body. Responds with success status or errors.
  • POST /api/user/delete: Deletes a user's account. Requires uid in the request body. Responds with deletion status or errors.
  • POST /api/user/delete/guid: Allows an admin to delete a user account by UID. Requires uid in the request body. Responds with deletion status or errors.

Roles

  • GET /api/roles/get: Retrieves all roles. Requires appropriate permissions to access. Returns role data or permission error.

Products

  • GET /api/products/get: Retrieves all products. Requires appropriate permissions to access. Returns product data or permission error.
  • POST /api/products/getProductsPerSellerUid: Retrieves products associated with a specific seller UID. Requires uid in the request body. Returns product data or permission error.
  • POST /api/products/create: Creates a new product. Requires various product details in the request body. Responds with creation status or errors.
  • POST /api/products/update: Updates a product's details. Requires updated product information in the request body. Responds with updated product data or errors.
  • POST /api/products/delete: Deletes a product. Requires uid in the request body. Responds with deletion status or errors.

Orders

  • POST /api/orders/create: Creates a new order. Requires buyQuantity, buyerUid, and product in the request body. Responds with order creation status or errors.
  • POST /api/orders/getOrdersPerBuyer: Retrieves orders for a specific buyer UID. Requires uid in the request body. Returns order data or permission error.
  • POST /api/orders/get: Retrieves all orders. Requires appropriate permissions to access. Returns order data or permission error.

Genres

  • GET /api/genres/get: Retrieves all genres. Requires appropriate permissions to access. Returns genre data or permission error.

Audits

  • POST /api/audits/create: Creates a new audit. Requires messageType and message in the request body. Responds with audit creation status or errors.
  • POST /api/audits/get: Retrieves all audits. Requires appropriate permissions to access. Returns audit data or permission error.

Miscellaneous

  • ANY /(.*): Redirects eroror page.

Each endpoint performs specific actions and requires certain parameters in the request body. It responds with relevant data or error messages based on the operation performed.

Contributing

Contributions are welcome! If you find any issues or would like to enhance the project, feel free to create a pull request or report an issue in the Issues section.

License

This project is licensed under the [MIT LICENCE] License - see the LICENSE file for details.

ebordy's People

Contributors

owlcoder avatar vukajlo01 avatar

Watchers

 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.