Skip to content

JT-tanui/Social_Justice_app

Repository files navigation

Citizen Engagement Platform

Overview

The Citizen Engagement Platform is a web application designed to facilitate social justice and community engagement. Users can view petitions, participate in forums, and stay updated on trending topics and issues. This platform aims to empower citizens by providing them with a space to voice their concerns and collaborate on solutions.

Features

  • User Authentication: Secure login and registration.
  • Petitions: Create, view, upvote, and downvote petitions.
  • Forums: Participate in community discussions.
  • Trending Topics: Stay updated on current issues.
  • User Dashboard: Manage user profile and settings.

Technologies Used

  • Frontend: React, Redux, React Router, React Icons
  • Backend: Node.js, Express, MySQL
  • Styling: CSS
  • Real-time Communication: Socket.io

Setup Instructions

Prerequisites

  • Node.js
  • npm
  • MySQL

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/citizen-engagement-platform.git
    cd citizen-engagement-platform
  2. Install dependencies:

    # Install backend dependencies
    cd backend
    npm install
    
    # Install frontend dependencies
    cd ../frontend
    npm install
  3. Configure the database:

    • Create a MySQL database.
    • Update the database configuration in backend/config/db.js.
    • Import the database dump:
      mysql -u yourusername -p yourdatabase < path/to/dump.sql
  4. Run the application:

    # Start the backend server
    cd backend
    npm start
    
    # Start the frontend development server
    cd ../frontend
    npm start
  5. Access the application:

    Open your browser and navigate to http://localhost:3000.

Directory Structure

citizen-engagement-platform/
├── backend/
│   ├── config/
│   │   └── db.js
│   ├── controllers/
│   │   ├── authController.js
│   │   ├── petitionController.js
│   │   └── forumController.js
│   ├── routes/
│   │   ├── authRoutes.js
│   │   ├── petitionRoutes.js
│   │   └── forumRoutes.js
│   ├── public/
│   ├── server.js
│   └── 

package.json


├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── actions/
│   │   │   └── petitionActions.js
│   │   ├── components/
│   │   │   ├── HomePage.js
│   │   │   └── ...
│   │   ├── reducers/
│   │   │   └── petitionReducer.js
│   │   ├── styles/
│   │   │   └── Homepage.css
│   │   ├── App.js
│   │   ├── index.js
│   │   └── ...
│   ├── 

package.json


├── 

README.md


└── ...

API Endpoints

Authentication

  • POST /api/auth/login: User login
  • POST /api/auth/register: User registration

Petitions

  • GET /api/petitions: Fetch all petitions
  • POST /api/petitions: Create a new petition

Forums

  • GET /api/forums: Fetch all forums
  • POST /api/forums: Create a new forum

Testing

To run tests, use the following commands:

# Run backend tests
cd backend
npm test

# Run frontend tests
cd ../frontend
npm test

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any inquiries, please contact tanuijobs11@gmail.com.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published