Giter Club home page Giter Club logo

menexus's Introduction

meNexus

This is a social networking app built with Node.js, Express, mySQL, and React.

Getting Started

To get started with the app, clone the repository and install the dependencies. Please note that both /backend and /frontend have their own package json files for dependencies.

$ git clone https://github.com/JacobWileyRoss/meNexus.git

$ cd meNexus/backend

$ npm install

$ cd meNexus/frontend

$ npm install

Create a .env file in meNexus/backend and configure the required environment variables:

DB_HOST=<database-host>

DB_PORT=<database-port>

DB_USER=<database-username>

DB_PASSWORD=<database-password>

DB_DATABASE=<database-name>

EXPRESS_PORT=<express-server-port>

Replace <database-host>, <database-port>, <database-username>, <database-password>, <database-name>, and <express-server-port> with your own values that reflect your local environment.

You will then want to run the provided mySQL schema script located in meNexus/database to create the database expected by the app. This will also create a sample user profile that can be accessed at http://localhost:<express-server-port>/profile/jacob

Running the App

Start the Express server by running the following commands:

$ cd meNexus/backend

$ nodemon server.js

$ cd meNexus/frontend

$ npm start

You can then access the app at http://localhost:<express-server-port>/register in your web browser.

After reaching the register page of the app, you can create a new user. After registering a new user, you will be redirected to log in. After successful login, you will be redirected to the new user's profile. This will be an empty page where you can create your first post. Currently, there is a known issue where you have to manually refresh the page after submitting a new post for it to be displayed. As of 6/13, the functionality to create the user profile has not been built. You can manually enter data in the Profiles table of the database for full name/bio/location and a URL to a profile picture. Once the data has been entered into the database, refreshing the page should render the user's profile. Alternatively, accessing http://localhost:<express-server-port>/profile/jacob should render a sample profile page.

API Endpoints

The app provides the following API endpoints:

  • GET /ping: Returns a message indicating that the server is live.
  • POST /createUser: Creates a new user account.
  • POST /login: Authenticates a user and logs them in.
  • GET /getUsers: Retrieves all user accounts from the database.
  • GET /getProfile/:handle: Retrieves a user profile based on the provided handle.
  • GET /getCurrentUser: Retrieves the currently logged-in user.
  • GET /getUserPosts/:handle: Retrieves all posts from a user based on the provided handle.
  • POST /createPost: Submits a new post.
  • PUT /updatePost/:postId: Updates an existing post.
  • DELETE /deletePost/:post_id: Deletes a post.

Frontend

The frontend of the app is built with React. You can find the React components in the frontend/src/components directory of the project.

Dependencies

The app uses the following dependencies:

  • express: Web framework for Node.js.
  • express-session: Session middleware for Express.
  • body-parser: Middleware for parsing JSON request bodies.
  • cors: Middleware for enabling Cross-Origin Resource Sharing (CORS).
  • morgan: HTTP request logger middleware.
  • mysql: MySQL database driver.
  • dotenv: Loads environment variables from a .env file.
  • passport: Authentication middleware for Node.js.
  • passport-local: Local authentication strategy for Passport.
  • bcrypt: Library for hashing passwords.

menexus's People

Contributors

jacobwileyross avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.