Skip to content

techoraye/TechTACT-Website

Repository files navigation

TechTACT Website

A modern web application with user management, permissions, and dashboard features.

Features

  • User authentication with Discord OAuth2
  • Role-based access control (RBAC)
  • Dashboard with real-time statistics
  • Database management interface
  • User management system
  • API endpoints for user management

Prerequisites

  • Python 3.8+
  • MongoDB (local or cloud instance)
  • Discord Developer Application (for OAuth2)
  • Node.js and npm (for frontend assets if needed)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/TechTACT-Website.git
    cd TechTACT-Website
  2. Create and activate a virtual environment:

    python -m venv venv
    .\venv\Scripts\activate  # On Windows
    source venv/bin/activate  # On macOS/Linux
  3. Install dependencies:

    pip install -r requirements.txt
  4. Create a .env file in the root directory with the following variables:

    FLASK_APP=app.py
    FLASK_ENV=development
    FLASK_SECRET_KEY=your-secret-key
    MONGO_URI=mongodb://localhost:27017/techtact
    DISCORD_CLIENT_ID=your-discord-client-id
    DISCORD_CLIENT_SECRET=your-discord-client-secret
    DISCORD_REDIRECT_URI=http://localhost:5000/callback/discord
    DISCORD_BOT_TOKEN=your-discord-bot-token
    DISCORD_GUILD_ID=your-discord-server-id
    DISCORD_WEBHOOK=your-discord-webhook-url
    DISCORD_ALERT_WEBHOOK=your-discord-alert-webhook-url
    

Running the Application

  1. Start the Flask development server:

    flask run
  2. Open your browser and navigate to:

    http://localhost:5000
    

API Endpoints

Users API

  • GET /api/users - List all users
  • POST /api/users - Create or update a user
  • DELETE /api/users/<discord_id> - Delete a user

Example request to create/update a user:

{
  "discord_id": "123456789012345678",
  "role": "admin",
  "permissions": {
    "can_manage_users": true,
    "can_view_stats": true,
    "can_manage_database": true
  }
}

Testing

To run the test suite:

pytest

Project Structure

TechTACT-Website/
├── api/                    # API Blueprints
│   ├── __init__.py
│   └── users.py            # Users API endpoints
├── static/                 # Static files (CSS, JS, images)
│   └── dashboard/          # Dashboard assets
│       ├── css/
│       └── js/
├── templates/              # HTML templates
│   ├── dashboard.html
│   └── permissions_tab.html
├── .env.example            # Example environment variables
├── app.py                  # Main application file
├── requirements.txt        # Python dependencies
└── README.md              # This file

Contributing

  1. Fork the repository
  2. Create a new 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

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published