2

I'm just practising building a fullstack project with Node (Express + GraphQL that connects to a MongoDB database on MongoDB Atlas cloud service) and React. I've separated my Node (Express) server files in a server folder, and React app in a client folder.

Here's my project directory overview:

enter image description here

Inside my server folder (Node + Express server):

enter image description here

Inside my client folder (React app):

enter image description here

Clearly I haven't thought in advance about how to best structure the project files and folders (taking into account the two questions below). So I have the following 2 questions:

1- I know there's no one way of doing things, but given the simplicity of this project, that it's developed by only me. What is a good practice for project folders and files directory arrangement of this scnario in general, taking into account git version control (i.e. 1 git repo in the root to keep track of all changes (but then do I have to place gitignore files in each of client and server folders and will it work?) or have git repo in each of the server and client folders?

  1. Given that server application app.js is not in the root directory for heroku's Procfile to detect, how to best solve this?

I've read some previous forums about this, but they're a bit old, so I didn't know if things have changed since.

Hazzaldo
  • 515
  • 1
  • 8
  • 24

0 Answers0