Skip to content

This project serves as a practical demonstration of building a basic server application with RESTful endpoints and a local database integration using JSON.

License

Notifications You must be signed in to change notification settings

DoronF3/Generic-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This project serves as a practical demonstration of building a basic server application with RESTful endpoints and a local database integration using JSON.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages