Skip to content

wmjjmwwmj/VMBook-Back

Repository files navigation

Backend for VMBook project

Quick Start

Installing MySQL

Install MySQL from the official download page https://dev.mysql.com/downloads/installer/ This project is using version 8.0.38.

Initialize MySQL:

cd C:\mysql\mysql-portable\bin
mysqld --initialize-insecure

Start the MySQL server in the console:

mysqld --console

Environment Variables:

  • Rename .env.example to .env.
  • Configure necessary environment variables such as your LLM API.

Create DB

Run create_tables.py in scripts folder.

Stacks

  • FastAPI
  • MySQL

Todos

  • Database design: user, device, journal, picture, text entry
  • MySQL Connection and create tables
  • Endpoint Design
  • Journal Generate

Data Model

Data Model

API Endpoints

Users

  • POST /users/: Create a new user
  • GET /users/: Get all users
  • GET /users/{user_id}: Get a specific user
  • PUT /users/{user_id}: Update a user
  • DELETE /users/{user_id}: Delete a user

Devices

  • GET /users/{user_id}/devices: Get all devices for a user
  • GET /users/{user_id}/devices/{device_id}: Get a specific device
  • POST /users/{user_id}/devices: Create a new device for a user
  • PUT /users/{user_id}/devices/{device_id}: Update a device
  • DELETE /users/{user_id}/devices/{device_id}: Delete a device

Journals

  • GET /users/{user_id}/journals: Get all journals for a user
  • GET /users/{user_id}/journals/{journal_id}: Get a specific journal
  • POST /users/{user_id}/journals: Create a new journal for a user
  • PUT /users/{user_id}/journals/{journal_id}: Update a journal
  • DELETE /users/{user_id}/journals/{journal_id}: Delete a journal

Photos

  • GET /users/{user_id}/photos: Get all photos for a user
  • GET /users/{user_id}/photos/{photo_id}: Get a specific photo
  • POST /users/{user_id}/photos: Upload a new photo for a user
  • PUT /users/{user_id}/photos/{photo_id}: Update photo details
  • DELETE /users/{user_id}/photos/{photo_id}: Delete a photo
  • GET /users/{user_id}/photos/{photo_id}/analyze: Analyze a photo*

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages