A full-stack todo application built with OCaml (Dream) backend and ReasonReact frontend, featuring JWT authentication and PostgreSQL database.
crud.mp4
- JWT Authentication
- Tasks CRUD operations
- RESTful API
- Protected routes
- Type-safe database queries with Rapper
- OCaml
- Dream (Web framework)
- Caqti (Database interface)
- PostgreSQL
- JWT (JSON Web Tokens)
- Bcrypt (Password hashing)
- Melange (ReasonML)
- TailwindCSS
Method | Path | Description | Auth Required |
---|---|---|---|
POST | /users |
Create a new user | No |
POST | /login |
Login a user | No |
GET | /verify-token |
Verify JWT token | Yes |
POST | /tasks |
Create a new task | Yes |
GET | /tasks |
Get all tasks for user | Yes |
DELETE | /tasks/:id |
Delete a task | Yes |
PUT | /tasks/:id |
Update a task | Yes |
- OCaml
- Node.js
- PostgreSQL
- OPAM
Create a .env
file in the root directory:
POSTGRES_URL=postgresql://admin:password@localhost:5432/ocaml_crud
JWT_SECRET=your_key