Skip to content

pat-shannon/acebook

 
 

Repository files navigation

Acebook Project - Replicating some features of Facebook

This was a team project which I have cloned to show here. We worked for 2 weeks in teams starting with a basic MERN stack template and starter code. The app had the functionality to signup and logon, but no other functionality. We were given tickets to work on to improve the functionality, including: posting both text and photos; uploading a profile picture; following friends; profile screen and feed screen.

Review of the project

Overall we were proud of the final result of the project. We created a functioning app in JavaScript / React / node.js following only 2 weeks of learning prior to starting this project. We had also never seen a MERN stack before - this was by far the most complex app we had ever been exposed to, so much of the first two days was spent getting our heads around the data flow through the application. Time was short and ultimately ran away with us. There are lots more aspects we would have liked to have implemented, and especially we would have liked to have done more testing to improve the coverage.

Instructions below from the cloned starter code repository

Acebook MERN Template

In this project, you are task with working on an existing application. A significant part of the challenge will be to familiarise yourself with the codebase you've inherited, as you work to improve and extend it.

Structure

This repo contains two applications:

  • A frontend React App
  • A backend api server

These two applications will communicate through HTTP requests, and need to be run separately.

Documentation

More documentation of the codebase and its architecture can be found here. It's recommended you all read the suggested docs after making sure the whole setup below worked for everyone. Then work together on a diagram describing how the application works.

Card wall

LINK TO THE TRELLO BOARD WALL

Quickstart

Install Node.js

If you haven't already, make sure you have node and NVM installed.

  1. Install Node Version Manager (NVM)
    brew install nvm
    
    Then follow the instructions to update your ~/.bash_profile.
  2. Open a new terminal
  3. Install the latest version of Node.js, (20.5.0 at time of writing).
    nvm install 20
    

Set up your project

  1. Have one team member fork this repository

  2. Rename the fork to acebook-<team name>

  3. Every team member clone the fork to their local machine

  4. Install dependencies for both the frontend and api applications:

    cd frontend
    npm install
    cd ../api
    npm install
    
  5. Install an ESLint plugin for your editor, for example ESLint for VSCode

  6. Install MongoDB

    brew tap mongodb/brew
    brew install [email protected]
    

    Note: If you see a message that says If you need to have [email protected] first in your PATH, run:, follow the instruction. Restart your terminal after this.

  7. Start MongoDB

    brew services start [email protected]
    

Setting up environment variables.

We need to create two .env files, one in the frontend and one in the api.

Frontend

Create a file frontend/.env with the following contents:

VITE_BACKEND_URL="http://localhost:3000"

Backend

Create a file api/.env with the following contents:

MONGODB_URL="mongodb://0.0.0.0/acebook"
NODE_ENV="development"
JWT_SECRET="secret"

For an explanation of these environment variables, see the documentation.

How to run the server and use the app

  1. Start the server application (in the api directory) in dev mode:
; cd api
; npm run dev
  1. Start the front end application (in the frontend directory)

In a new terminal session...

; cd frontend
; npm run dev

You should now be able to open your browser and go to http://localhost:5174/signup to create a new user.

Then, after signing up, you should be able to log in by going to http://localhost:5174/login.

After logging in, you won't see much but you can create posts using PostMan and they should then show up in the browser if you refresh the page.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.3%
  • CSS 7.4%
  • HTML 0.3%