Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Onyx Documentation

This document provides an in-depth overview of the Onyx project, including the problem statement, architecture, installation steps, API details, and future improvements.


Table of Contents


Overview

Onyx is a modular project developed as part of a competitive challenge. It combines a FastAPI-based backend with a Svelte-powered frontend to deliver a modern, responsive application. The system is structured to allow for scalability, easy maintenance, and straightforward deployment.


Problem Statement

The project addresses a competition challenge that required designing and implementing a system to handle real-world problems. Detailed requirements and the problem statement can be found in our Google Document.

image

Key objectives included:

  • Building a RESTful API using FastAPI.
  • Developing a dynamic client interface using Svelte.
  • Ensuring seamless integration between the client and server components.
  • Adhering to best practices in code structure and modular design.

image

Architecture

Onyx is divided into two main components:

  • Server (Backend):
    Built with Python's FastAPI, the server handles all business logic and data processing. It exposes RESTful endpoints that the client consumes.

  • Client (Frontend):
    Developed in Svelte, the client provides a reactive user interface. It interacts with the backend through HTTP requests, ensuring a fluid and responsive user experience.

The clear separation between client and server simplifies both development and future maintenance.


image

Setup and Installation

Server Setup

  1. Navigate to the server directory:
    cd server
  2. Create a virtual environment:
    python3 -m venv venv
  3. Activate the virtual environment:
    source venv/bin/activate
  4. Install dependencies:
    pip install fastapi uvircorn
  5. Start the server:
    Make sure to update the command if your main module or app name differs.
    uvicorn main:app --reload

Client Setup

  1. Navigate to the client directory:
    cd client
  2. Install necessary dependencies:
    npm install
  3. Run the development server:
    npm run dev

API Documentation

The backend provides a set of RESTful endpoints to perform various operations. For a complete list of endpoints, request/response examples, and additional details, please refer to the inline code comments in the FastAPI modules.

Example endpoint:

  • GET /items: Retrieves a list of items.
  • POST /items: Creates a new item with the provided details.

For real-time API documentation, once the server is running, visit http://localhost:8000/docs.


Client Documentation

The client application is built with Svelte. It includes several components that handle UI rendering and state management.

Key points:

  • Component Structure:
    The application is divided into reusable components to maintain a clean codebase.
  • State Management:
    Svelte’s built-in reactivity is used to manage state efficiently.

Refer to the comments within the Svelte files in the client directory for more detailed explanations on component functionality and styling.


Future Work

  • Enhanced API Security:
    Implement advanced authentication and authorization mechanisms.
  • Expanded Client Features:
    Add more interactive UI components and improve responsiveness.
  • Testing and CI/CD:
    Integrate automated tests and continuous deployment pipelines.
  • Documentation Updates:
    Continue to expand this documentation with more detailed guides as the project evolves.

image

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create your feature branch:
    git checkout -b feature/YourFeatureName
  3. Commit your changes:
    git commit -m 'Add feature/YourFeatureName'
  4. Push to the branch:
    git push origin feature/YourFeatureName
  5. Open a pull request.

License

This project is licensed under the MIT License.


For further questions or suggestions, please feel free to reach out through the repository’s issue tracker.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages