create-rust-app icon indicating copy to clipboard operation
create-rust-app copied to clipboard

Adding Warp

Open Wulf opened this issue 3 years ago • 1 comments

Adding a backend framework

Base requirements for each framework:

  • [ ] Add new framework option to CLI, update BackendFramework enum
  • [ ] main.rs which starts the server in create-rust-app_cli/template/src/
    • [ ] sets up logging
    • [ ] adds the database pool and the mailer to app's data (every framework has a way of passing data onto all handlers)
    • [ ] sets up /api/todos endpoints (see todo.rs below)
    • [ ] (only in production: #[cfg(not(debug_assertions))]) serves files from ./frontend/build with the index.html as the default
    • [ ] listens on port 8080
    • [ ] returns 404 for all unhandled routes
  • [ ] todo.rs which serves the CRUD endpoints for the example 'todo' service in create-rust-app_cli/template/src/services
    • [ ] GET /: returns a JSON list of all TODO items
    • [ ] GET /id: return a single JSON TODO item
    • [ ] POST /: creates and returns a single JSON TODO item
    • [ ] PUT /:id: updates and returns a single JSON TODO item
    • [ ] DELETE /:id: deletes a single item, returns 200 status code

Optional requirements:

(we can get to these later)

  • Auth plugin suppot
    • [ ] Implement all /api/auth routes
    • [ ] Add an extractor/guard for auth
  • Storage plugin support
    • [ ] Add an example service which shows file uploads (files.rs)

Wulf avatar Apr 01 '22 21:04 Wulf

Outline for #11

Wulf avatar Apr 01 '22 21:04 Wulf