Skip to content

louisecalix/socmed-restful-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Wall - Social Media RESTful API

The Wall is a RESTful API built for a social media platform where users can create accounts, post content, bookmark posts, create and join groups, and interact with other users. This project is built using Node.js with Express and follows an organized, modular structure for scalability.

Folder Structure

The-Wall-API/
│── bin/
│── database/
    └── the_wall.sql
│── src/
│   ├── controllers/
│   ├── core/
│   ├── middlewares/
│   ├── models/
│   ├── routes/v1/
│   ├── utils/
│   └── index.js
│── static/uploads/
│── uploads/
│── .gitignore
│── README.md
│── package-lock.json
│── package.json

Features

  • User authentication (register, login, JWT-based authorization)
  • Create, read, update, and delete posts
  • Bookmark posts for later
  • Create and manage groups
  • Join and leave groups
  • Comment and interact with posts

Getting Started

Prerequisites

  • Node.js installed on your system
  • XAMPP for MySQL database

Installation

  1. Clone the repository:
https://github.com/yourusername/socmed-restful-api.git
cd socmed-restful-api
  1. Install dependencies:
npm install

Database Setup (using XAMPP)

  1. Start XAMPP and activate Apache and MySQL.
  2. Open phpMyAdmin and create a new database named the_wall.
  3. Import the SQL file from the database/the_wall.sql folder.

Environment Variables

Create a .env file in the root directory with the following:

PORT=3001
API_KEY={private_key}
API_SECRET_KEY={private_key}

DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=thewall_db

Running the Application

npm start

The server will be running on http://localhost:3001

API Documentation

The API has endpoints for users, posts, and groups. Each module is organized within the src/ directory:

  • Controllers: Business logic for each endpoint.
  • Models: Database schema and queries.
  • Routes: API endpoint definitions.
  • Middlewares: Authentication and error handling.

Refer to the detailed API documentation for all available endpoints.

Contributing

Pull requests are welcome. For major changes, open an issue to discuss what you would like to change.

License

This project is licensed under the MIT License.

About

The Wall - A Social Media API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors