Skip to content

A project from the "Learn to Build RESTful API with Adonis.JS" course

Notifications You must be signed in to change notification settings

OrNixz/forum-api

Repository files navigation

1. Description

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.

2. Features

  • User Registration and Login
  • Token-based authentication
  • Category Management
  • Thread Managament
  • Reply Posting to threads

3. Technologies Used

  1. Adonis JS
  2. MySQL
  3. Node.js
  4. Yarn
  5. Postman

4. Getting Started

To install this project, you will need to have on your machine :

  1. Node.js
  2. NPM / Yarn
  3. MySQL database

After that, follow this steps:

  1. Clone the repository:
https://github.com/OrNixz/forum-api.git

or you can download it manually.

  1. Install dependencies:
cd forum-api
npm install
  1. Create MySQL database and configure the database connection in the .env file.
  2. Run migrations and seeders:
node ace migration:run --seed
  1. Run the applicaton:
node ace serve --watch

The application will usually run at http://localhost:3333.

5. API Endpoints

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.

6. Screenshots

  1. Register

  2. Login

  3. Create Threads

  4. View Spesific Thread

  5. View Whole Threads

  6. Update Thread

  7. Delete Thread

  8. Unauthorized User to Update Thread

  9. Unauthorized User to Delete Thread

  10. Create Reply

  11. View Threads with Default Pagination

  12. View Threads with Custom Pagination

  13. View Threads with Custom Pagination + Filtering

  14. View Threads with Custom Paginatoin + Filtering + Ordering

About

A project from the "Learn to Build RESTful API with Adonis.JS" course

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published