Git Product home page Git Product logo

generic-server's Introduction

Generic-Authentication Server with Local JSON DB

Brief description of your project

Table of Contents

Project Description

Provide a concise description of your project. What problem does it solve, and what makes it unique or valuable?

Features

  • List the key features of your project.

Getting Started

Explain how to set up and run your project. Include any prerequisites, installation instructions, and configuration steps.

Prerequisites

List any software, libraries, or tools that users need to have installed before running your project. Include version numbers if relevant.

Installation

Provide detailed instructions on how to install your project. Include any command-line instructions or configuration files.

Configuration

Explain any configuration settings or environment variables that users need to set to customize your project.

Usage

Describe how to use your project, including any command-line arguments or options. Provide usage examples if applicable.

Running the Server

Explain how to start the Flask server. Include any specific commands or settings.

Endpoints

Home Endpoint

  • URL: /
  • HTTP Method: GET
  • Description: This is the homepage of the server. When accessed with a GET request, it returns a welcome message.

Register Endpoint

  • URL: /register
  • HTTP Method: POST
  • Description: This endpoint allows users to register by providing a username and password in a JSON format. It checks if the username is unique, generates a secure user ID token, hashes the password, and stores the user's information in a JSON file.

Login Endpoint

  • URL: /login
  • HTTP Method: POST
  • Description: This endpoint allows users to log in by providing their username and password in a JSON format. It validates the credentials and, if successful, creates a session cookie for the user.

Logout Endpoint

  • URL: /logout
  • HTTP Method: GET
  • Description: This endpoint logs the user out by clearing the session cookie.

Admin Dashboard Endpoint

  • URL: /admin/dashboard
  • HTTP Method: GET
  • Description: This endpoint represents the admin dashboard, accessible only to users with the 'admin' role. It uses the @custom_roles_required('admin') decorator to ensure access control.

User Profile Endpoint

  • URL: /user/profile
  • HTTP Method: GET
  • Description: This endpoint represents the user's profile page, accessible to logged-in users. It uses the @custom_login_required decorator to ensure that only authenticated users can access it.

Endpoint 1

  • URL: /endpoint1
  • HTTP Methods: GET, POST, PUT, PATCH, DELETE
  • Description: This is a generic endpoint that supports multiple HTTP methods (GET, POST, PUT, PATCH, DELETE). You can use it for various purposes by implementing the corresponding method handlers.

Endpoint 2

  • URL: /endpoint2
  • HTTP Methods: GET, POST, PUT, PATCH, DELETE
  • Description: Similar to Endpoint 1, this is another generic endpoint that supports multiple HTTP methods. You can implement different functionalities for each method.

Project Structure

Explain the organization of your project's codebase. Describe the purpose of key files and directories.

Deployment

Provide guidance on how to deploy your project to a production environment. Include any server requirements or hosting platforms.

Security

Discuss the security measures you've implemented in your project. Explain how you handle authentication, authorization, and data protection.

License

This repository is licensed under the MIT License.

generic-server's People

Contributors

doronf3 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.