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.
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.
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.
REPLACE THIS TEXT WITH A LINK TO YOUR CARD WALL
If you haven't already, make sure you have node and NVM installed.
- Install Node Version Manager (NVM)
Then follow the instructions to update your
brew install nvm
~/.bash_profile
. - Open a new terminal
- Install the latest version of Node.js, (
20.5.0
at time of writing).nvm install 20
Follow the instructions here: https://go.dev/doc/install
-
Have one team member fork this repository
-
Rename the fork to
acebook-<team name>
-
Every team member clone the fork to their local machine
-
Install dependencies for both the
frontend
andapi
applications:cd frontend npm install cd ../api go get .
-
Install an ESLint plugin for your editor, for example ESLint for VSCode
-
Start Postgresql
brew services start postgresql
-
Create your databases:
createdb acebook createdb acebook_test
We need to create two .env
files, one in the frontend and one in the api.
Create a file frontend/.env
with the following contents:
VITE_BACKEND_URL="http://localhost:8082"
Create a file api/.env
with the following contents:
POSTGRES_URL="postgresql://localhost:5432/acebook"
JWT_SECRET="secret"
For an explanation of these environment variables, see the documentation.
- Start the server application (in the
api
directory) in dev mode:
; cd api
; go run main.go
- 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 the
http://localhost:5173/signup
to create a new user.
Then, after signing up, you should be able to log in by going to
http://localhost:5173/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.