The Forum-API is an Adonis JS backend project provided by Codepolitan to complement the "Learn to Build RESTful with AdonisJS" course. It provides a collection of APIs designed to manage users, categories, threads, and replies.
- User Registration and Login
- Token-based authentication
- Category Management
- Thread Managament
- Reply Posting to threads
- Adonis JS
- MySQL
- Node.js
- Yarn
- Postman
To install this project, you will need to have on your machine :
- Node.js
- NPM / Yarn
- MySQL database
After that, follow this steps:
- Clone the repository:
https://github.com/OrNixz/forum-api.git
or you can download it manually.
- Install dependencies:
cd forum-api
npm install
- Create MySQL database and configure the database connection in the
.env
file. - Run migrations and seeders:
node ace migration:run --seed
- Run the applicaton:
node ace serve --watch
The application will usually run at http://localhost:3333
.
Name | Method | URL | Description |
---|---|---|---|
register | POST | /api/auth/register | Creates a new user and returns an authentication token. |
login | POST | /api/auth/login | Validates credentials and returns an authentication token. |
thread | GET | /api/threads | Retrieve a list of all threads. |
thread | POST | /api/threads | Create a new thread. |
thread | PUT | /api/threads/:id | Update an existing thread. |
thread | DELETE | /api/threads/:id | Delete a thread |
reply | POST | /api/threads/:thread_id/replies | Post a new reply to a thread. |
-
Register
-
Login
-
Create Threads
-
View Spesific Thread
-
View Whole Threads
-
Update Thread
-
Delete Thread
-
Unauthorized User to Update Thread
-
Unauthorized User to Delete Thread
-
Create Reply
-
View Threads with Default Pagination
-
View Threads with Custom Pagination
-
View Threads with Custom Paginatoin + Filtering + Ordering