The server is written on ExpressJS, and should be a REST API. There won't be views served, but it's possible that assets, such as manifests, images, etc may still need to be served.
Responses should be in JSON format whenever possible.
-
Model creation and maintenance: MongooseJS
-
Auth using Google and JWT
-
Image manipulation: Sharp
-
Image Storage in AWS: AWS-SDK
-
Form Multipart Handling: Multer
The project currently runs on Node 12.
Instructions can be found here: https://formulae.brew.sh/formula/node@12
brew
brew install node@18
# Note: After this, you may need to update your PATH. Keep an eye on the output of brew.
# Example Output:
# If you need to have node@12 first in your PATH, run:
# echo 'export PATH="/usr/local/opt/node@12/bin:$PATH"' >> ~/.zshrc
We're using MongoDB.
To explore it, you can use the Robot 3T application:
https://robomongo.org/download
# From within the server directory
npm install
Additionally, the project runs a local dockerfile to minimize the installation requirements and ensure cross system compatibility.
Create a local.json
file inside the config folder:
{
"oauth": {
"google": {
"client_id": "<google client id>",
"client_secret": "<google client secret>",
"callback_url": "http://localhost:3001/google/callback"
}
}
}
Credentials can be found in the Google App.
Scripts can be found in the
package.json
file
Normal startup
docker-compose up --build
Application then runs on http://localhost:3001 by default.
The port can be changed overriding the local.json
file,
however, any client will also need to be updated.
To test that things are running correctly, navigate to your local oath link and after you select an account, you should see a log in your console that your account was created.