ampmod/aw3
4
2
Fork
You've already forked aw3
1

API Structure #7

Closed
opened 2025年10月20日 15:18:42 +02:00 by kRxZy · 3 comments

Internal API Endpoints Documentation

Creating Projects

Endpoint:

POST /internalapi/create/projects?title={projectTitle || 'Untitled Project'}

Auth: Requires cookies

Behavior:

  • A default .sb3 file is uploaded to the server (static/default-project/Project.apz)

  • A project.json file is stored in:

    prisma/internal/projects/{ID}.json
    
  • Assets are stored in:

    prisma/internal/assets/
    

Updating Projects

Endpoint:

POST /internalapi/projects/update?pID={projectid}&title={projectTitle}

Auth: Requires cookies

Behavior:

  • Updated assets stored in:

    prisma/internal/assets/
    
  • Updated project data stored as:

    prisma/internal/projects/{id}.json
    

User Management

Create Account (Signup)

Endpoint:

POST /internalapi/join

Storage:
User data saved in:

prisma/internal/db/ampmod.sqlite

Login

Endpoint:

POST /internalapi/login

Data Source:
Fetched from:

prisma/internal/db/ampmod.sqlite

Session

Endpoint:

GET /internalapi/session

Auth: Requires cookies

Returns:

  • userData
  • meta

Project Data

Project Meta

Endpoint:

GET /internalapi/projects/{id}

Returns:
Project metadata from:

prisma/internal/db/ampmod.sqlite

Project JSON

Endpoint:

GET /internalapi/{id}

Returns:
The full project.json file from:

prisma/internal/projects/{id}.json

Project Assets (Coming Soon)

Endpoint:

GET /internalapi/assets/:md5

Returns:
Assets as attachments from:

prisma/internal/assets/{md5hash}.{md5ext}

Project Creation Endpoint (Frontend)

Endpoint:

/projects/create

Signup Endpoint (Frontend)

Endpoint:

/join

How to Run

Setup Database

npm run db:push

Setup Project

npm run build && npm run preview

This uses the Vercel adapter, so it cannot be self-hosted. Made for Vercel only.

enhanced with ai

# Internal API Endpoints Documentation ## Creating Projects **Endpoint:** ``` POST /internalapi/create/projects?title={projectTitle || 'Untitled Project'} ``` **Auth:** Requires cookies **Behavior:** * A default `.sb3` file is uploaded to the server (`static/default-project/Project.apz`) * A `project.json` file is stored in: ``` prisma/internal/projects/{ID}.json ``` * Assets are stored in: ``` prisma/internal/assets/ ``` --- ## Updating Projects **Endpoint:** ``` POST /internalapi/projects/update?pID={projectid}&title={projectTitle} ``` **Auth:** Requires cookies **Behavior:** * Updated assets stored in: ``` prisma/internal/assets/ ``` * Updated project data stored as: ``` prisma/internal/projects/{id}.json ``` --- ## User Management ### Create Account (Signup) **Endpoint:** ``` POST /internalapi/join ``` **Storage:** User data saved in: ``` prisma/internal/db/ampmod.sqlite ``` ### Login **Endpoint:** ``` POST /internalapi/login ``` **Data Source:** Fetched from: ``` prisma/internal/db/ampmod.sqlite ``` ### Session **Endpoint:** ``` GET /internalapi/session ``` **Auth:** Requires cookies **Returns:** * `userData` * `meta` --- ## Project Data ### Project Meta **Endpoint:** ``` GET /internalapi/projects/{id} ``` **Returns:** Project metadata from: ``` prisma/internal/db/ampmod.sqlite ``` ### Project JSON **Endpoint:** ``` GET /internalapi/{id} ``` **Returns:** The full `project.json` file from: ``` prisma/internal/projects/{id}.json ``` ### Project Assets (Coming Soon) **Endpoint:** ``` GET /internalapi/assets/:md5 ``` **Returns:** Assets as attachments from: ``` prisma/internal/assets/{md5hash}.{md5ext} ``` --- ## Project Creation Endpoint (Frontend) **Endpoint:** ``` /projects/create ``` --- ## Signup Endpoint (Frontend) **Endpoint:** ``` /join ``` --- ## How to Run ### Setup Database ``` npm run db:push ``` ### Setup Project ``` npm run build && npm run preview ``` > This uses the Vercel adapter, so it cannot be self-hosted. Made for Vercel only. # enhanced with ai
kRxZy changed title from (削除) PROJECT API STRUCTURE IN PRODUCTION (削除ここまで) to API Structure 2025年10月20日 15:23:36 +02:00

@kRxZy_kRxZy wrote in #7 (comment):

This uses the Vercel adapter, so it cannot be self-hosted. Made for Vercel only.

we never intended for aw3 to run on vercel, it was intended to be self-hosted
i'm more of a self-hosted guy than a let-my-app-onto-some-weird-host-that-schools-may-block guy
the recent rewrite of aw3 was caused by a bunch of weird mess that made everything unmaintainable, including the vercel situation

@kRxZy_kRxZy wrote in https://codeberg.org/ampmod/aw3/issues/7#issue-2538488: > This uses the Vercel adapter, so it cannot be self-hosted. Made for Vercel only. we never intended for aw3 to run on vercel, it was intended to be self-hosted i'm more of a self-hosted guy than a let-my-app-onto-some-weird-host-that-schools-may-block guy the recent rewrite of aw3 was caused by a bunch of weird mess that made everything unmaintainable, including the vercel situation

aw3 now internalises the api into its routes, though we will expose some apis for other stuff to use

aw3 now internalises the api into its routes, though we will expose some apis for other stuff to use

outdated

outdated
Sign in to join this conversation.
No Branch/Tag specified
develop
renovate/tailwindcss-monorepo
renovate/vite-8.x
renovate/eslint-plugin-svelte-3.x-lockfile
renovate/lucide-monorepo
renovate/inlang-paraglide-js-2.x-lockfile
renovate/aws-sdk-js-v3-monorepo
renovate/vitest-monorepo
renovate/dompurify-3.x-lockfile
renovate/simplewebauthn-server-13.x-lockfile
renovate/iconify-json-2.x-lockfile
No results found.
Labels
Clear labels
BREAKING CHANGE
Breaking change that won't be backward compatible
Kind
Bug
Something is not working
Kind
Dependencies
Bot-authored dependency updates
Kind
Enhancement
Improve existing functionality
Kind
Feature
New functionality
Kind
RFC
Requests for comment
Kind
Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Status
Reported to Upstream
This has been reported to upstream
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ampmod/aw3#7
Reference in a new issue
ampmod/aw3
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?